亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ch19.htm

?? Learn SQL in an easy way...
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
10) do not support the use of scrollable cursors. Example 19.10 gives you an ideaof how to use a <TT>WHILE</TT> loop to implement a rough cursor-type functionalitywhen that functionality is not automatically supplied.<H4><FONT COLOR="#000077">Example 19.10</FONT></H4><P>You can use the <TT>WHILE</TT> loop to scroll through tables one record at a time.Transact-SQL stores the <TT>rowcount</TT> variable that can be set to tell SQL Serverto return only one row at a time during a query. If you are using another databaseproduct, determine whether your product has a similar setting. By setting <TT>rowcount</TT>to <TT>1</TT> (its default is <TT>0</TT>, which means unlimited), SQL Serverreturns only one record at a time from a <TT>SELECT</TT> query. You can use thisone record to perform whatever operations you need to perform. By selecting the contentsof a table into a temporary table that is deleted at the end of the operation, youcan select out one row at a time, deleting that row when you are finished. When allthe rows have been selected out of the table, you have gone through every row inthe table! (As we said, this is a very rough cursor functionality!) Let's run theexample now.</P><H5>INPUT:</H5><PRE><FONT COLOR="#0066FF">1&gt; <B>set rowcount 1</B>2&gt;<B> declare @PLAYER char(30)</B>3&gt; <B>create table temp_BATTERS (</B>4&gt; <B>NAME char(30),</B>5&gt; <B>TEAM int,</B>6&gt; <B>AVERAGE float,</B>7&gt; <B>HOMERUNS int,</B>8&gt; <B>RBIS int)</B>9&gt;<B> insert temp_BATTERS</B>10&gt; <B>select * from BATTERS</B>11&gt; <B>while exists (select * from temp_BATTERS)</B>12&gt; <B>begin</B>13&gt;      <B>select @PLAYER = NAME from temp_BATTERS</B>14&gt;   <B>   print @PLAYER</B>15&gt;     <B> delete from temp_BATTERS where NAME = @PLAYER</B>16&gt; <B>end</B>17&gt; <B>print &quot;LOOP IS DONE!&quot;</B></FONT></PRE><H5>ANALYSIS:</H5><P>Note that by setting the <TT>rowcount</TT> variable, you are simply modifyingthe number of rows returned from a <TT>SELECT</TT>. If the <TT>WHERE</TT> clauseof the <TT>DELETE</TT> command returned five rows, five rows would be deleted! Alsonote that the <TT>rowcount</TT> variable can be reset repeatedly. Therefore, fromwithin the loop, you can query the database for some additional information by simplyresetting <TT>rowcount</TT> to <TT>1</TT> before continuing with the loop.<H2><FONT COLOR="#000077">Transact-SQL Wildcard Operators</FONT></H2><P>The concept of using wildcard conditions in SQL was introduced on Day 3, &quot;Expressions,Conditions, and Operators.&quot; The <TT>LIKE</TT> operator enables you to use wildcardconditions in your SQL statements. Transact-SQL extends the flexibility of wildcardconditions. A summary of Transact-SQL's wildcard operators follows.<UL>	<LI>The underscore character (<TT>_</TT>)represents any one individual character.	For example, <TT>_MITH</TT> tells the query to look for a five-character string ending	with <TT>MITH</TT>.	<P>	<LI>The percent sign (<TT>%</TT>) represents any one or multiple characters. For	example, <TT>WILL%</TT> returns the value <TT>WILLIAMS</TT> if it exists. <TT>WILL%</TT>	returns the value <TT>WILL</TT>.	<P>	<LI>Brackets (<TT>[ ]</TT>) allow a query to search for characters that are contained	within the brackets. For example, <TT>[ABC]</TT> tells the query to search for strings	containing the letters <TT>A</TT>, <TT>B</TT>, or <TT>C</TT>.	<P>	<LI>The <TT>^</TT> character used within the brackets tells a query to look for any	characters that are not listed within the brackets. For example, <TT>[^ABC]</TT>	tells the query to search for strings that do not contain the letters <TT>A</TT>,	<TT>B</TT>, or <TT>C</TT>.</UL><H2><FONT COLOR="#000077">Creating Summarized Reports Using COMPUTE</FONT></H2><P>Transact-SQL also has a mechanism for creating summarized database reports. Thecommand, <TT>COMPUTE</TT>, has very similar syntax to its counterpart in SQL*Plus.(See Day 20, &quot;SQL*Plus.&quot;)</P><P>The following query produces a report showing all batters, the number of homeruns hit by each batter, and the total number of home runs hit by all batters:</P><H5>INPUT:</H5><PRE><FONT COLOR="#0066FF"><B>select name, homerunsfrom batterscompute sum(homeruns)</B></FONT></PRE><H5>ANALYSIS:</H5><P>In the previous example, <TT>COMPUTE</TT> alone performs computations on the reportas a whole, whereas <TT>COMPUTE BY</TT> performs computations on specified groupsand the entire report, as the following example shows:</P><H5>SYNTAX:</H5><PRE><FONT COLOR="#0066FF">COMPUTE FUNCTION(expression) [BY expression]  where the FUNCTION might include SUM, MAX, MIN, etc. and  EXPRESSION is usually a column name or alias.</FONT></PRE><H2><FONT COLOR="#000077">Date Conversions</FONT></H2><P>Sybase and Microsoft's SQL Server can insert dates into a table in various formats;they can also extract dates in several different types of formats. This section showsyou how to use SQL Server's <TT>CONVERT</TT> command to manipulate the way a dateis displayed.</P><H5>SYNTAX:</H5><PRE><FONT COLOR="#0066FF">CONVERT (datatype [(length)], expression, format)</FONT></PRE><P>The following date formats are available with SQL Server when using the <TT>CONVERT</TT>function: <BR></P><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP">Format code</TD>		<TD ALIGN="LEFT" VALIGN="TOP">Format picture</TD>	</TR>	<TR>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>100</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>mon dd yyyy hh:miAM/PM</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>101</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>mm/dd/yy</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>102</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>yy.mm.dd</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>103</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>dd/mm/yy</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>104</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>dd.mm.yy</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>105</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>dd-mm-yy</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>106</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>dd mon yy</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>107</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>mon dd, yy</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>108</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>hh:mi:ss</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>109</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>mon dd, yyyy hh:mi:ss:mmmAM/PM</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>110</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>mm-dd-yy</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>111</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>yy/mm/dd</TT></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>112</TT></TD>		<TD VALIGN="TOP"><TT>yymmdd</TT></TD>	</TR></TABLE></P><H5>INPUT:</H5><PRE><FONT COLOR="#0066FF">select &quot;PayDate&quot; = convert(char(15), paydate, 107)from payment_tablewhere customer_id = 012845</FONT></PRE><H5><FONT COLOR="#000000">OUTPUT:</FONT><FONT COLOR="#0066FF"></FONT></H5><PRE><FONT COLOR="#0066FF">PayDate---------------May 1, 1997</FONT></PRE><H5>ANALYSIS:</H5><P>The preceding example uses the format code <TT>107</TT> with the <TT>CONVERT</TT>function. According to the date format table, code <TT>107</TT> will display thedate in the format <TT>mon dd, yy</TT>.<H2><FONT COLOR="#000077">SQL Server Diagnostic Tools--SET Commands</FONT></H2><P>Transact-SQL provides a list of <TT>SET</TT> commands that enable you to turnon various options that help you analyze Transact-SQL statements. Here are some ofthe popular <TT>SET</TT> commands:<UL>	<LI><TT>SET STATISTICS IO ON</TT> tells the server to return the number of logical	and physical page requests.	<P>	<LI><TT>SET STATISTICS TIME ON</TT> tells the server to display the execution time	of an SQL statement.	<P>	<LI><TT>SET SHOWPLAN ON</TT> tells the server to show the execution plan for the	designated query.	<P>	<LI><TT>SET NOEXEC ON</TT> tells the server to parse the designated query, but not	to execute it.	<P>	<LI><TT>SET PARSONLY ON</TT> tells the server to check for syntax for the designated	query, but not to execute it.</UL><P>Transact-SQL also has the following commands that help to control what is displayedas part of the output from your queries:<UL>	<LI><TT>SET ROWCOUNT </TT>n tells the server to display only the first n records	retrieved from a query.	<P>	<LI><TT>SET NOCOUNT ON</TT> tells the server not to report the number of rows returned	by a query.</UL><BLOCKQUOTE>	<P><HR><FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>If you are concerned with tuning	your SQL statements, refer to Day 15, &quot;Streamlining SQL Statements for Improved	Performance.&quot; <HR></BLOCKQUOTE><H2><FONT COLOR="#000077">Summary</FONT></H2><P>Day 19 introduces a number of topics that add some teeth to your SQL programmingexpertise. The basic SQL topics that you learned earlier in this book are extremelyimportant and provide the foundation for all database programming work you undertake.However, these topics are just a foundation. The SQL procedural language conceptsexplained yesterday and today build on your foundation of SQL. They give you, thedatabase programmer, a great deal of power when accessing data in your relationaldatabase.</P><P>The Transact-SQL language included with the Microsoft and Sybase SQL Server databaseproducts provide many of the programming constructs found in popular third- and fourth-generationlanguages. Its features include the <TT>IF</TT> statement, the <TT>WHILE</TT> loop,and the capability to declare and use local and global variables.</P><P>Keep in mind that Day 19 is a brief introduction to the features and techniquesof Transact-SQL code. Feel free to dive head first into your documentation and experimentwith all the tools that are available to you. For more detailed coverage of Transact-SQL,refer to the Microsoft SQL Server Transact-SQL documentation.<H2><FONT COLOR="#000077">Q&amp;A</FONT></H2><DL>	<DD><B>Q Does SQL provide a <TT>FOR</TT> loop?</B>	<P><B>A</B> Programming constructs such as the <TT>FOR</TT> loop, the <TT>WHILE</TT>	loop, and the <TT>CASE</TT> statement are extensions to ANSI SQL. Therefore, the	use of these items varies widely among database systems. For instance, Oracle provides	the <TT>FOR</TT> loop, whereas Transact-SQL (SQL Server) does not. Of course, a <TT>WHILE</TT>	loop can increment a variable within the loop, which can simulate the <TT>FOR</TT>	loop.</P>	<P><B>Q I am developing a Windows (or Macintosh) application in which the user interface	consists of Windows GUI elements, such as windows and dialog boxes. Can I use the	</B>PRINT<B> statement to issue messages to the user?</B></P>	<P><B>A</B> SQL is entirely platform independent. Therefore, issuing the <TT>PRINT</TT>	statement will not pop up a message box. To output messages to the user, your SQL	procedures can return predetermined values that indicate success or failure. Then	the user can be notified of the status of the queries. (The <TT>PRINT</TT> command	is most useful for debugging because a <TT>PRINT</TT> statement executed within a	stored procedure will not be output to the screen anyway.)</DL><H2><FONT COLOR="#000077">Workshop</FONT></H2><P>The Workshop provides quiz questions to help solidify your understanding of thematerial covered, as well as exercises to provide you with experience in using whatyou have learned. Try to answer the quiz and exercise questions before checking theanswers in Appendix F, &quot;Answers to Quizzes and Exercises.&quot;<H3><FONT COLOR="#000077">Quiz</FONT></H3><DL>	<DD><B>1.</B> True or False: The use of the word SQL in Oracle's PL/SQL and Microsoft/Sybase's	Transact-SQL implies that these products are fully compliant with the ANSI standard.	<P><B>2. </B>True or False: Static SQL is less flexible than Dynamic SQL, although	the performance of static SQL can be better.</DL><H3><FONT COLOR="#000077">Exercises</FONT></H3><DL>	<DD><B>1. </B>If you are not using Sybase/Microsoft SQL Server, compare your product's	extensions to ANSI SQL to the extensions mentioned today.	<P><B>2. </B>Write a brief set of statements that will check for the existence of	some condition. If this condition is true, perform some operation. Otherwise, perform	another operation.</DL><H1></H1><CENTER><P><HR><A HREF="../ch18/ch18.htm"><IMG SRC="../buttonart/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch20/ch20.htm"><IMGSRC="../buttonart/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../buttonart/contents.gif" WIDTH="128"HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A><BR><BR><BR><IMG SRC="../buttonart/corp.gif" WIDTH="284" HEIGHT="45" ALIGN="BOTTOM" ALT="Macmillan Computer Publishing USA"BORDER="0"></P><P>&#169; <A HREF="../copy.htm">Copyright</A>, Macmillan Computer Publishing. Allrights reserved.</CENTER></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美裸体bbwbbwbbw| 国产**成人网毛片九色 | 欧美亚洲综合一区| 亚洲一区中文日韩| 91精品久久久久久蜜臀| 蜜臀av一区二区| 精品国产制服丝袜高跟| 国产精品夜夜爽| 中文字幕在线不卡一区| 91久久精品一区二区| 亚洲成人一区二区在线观看| 日韩一区二区在线观看| 国产在线看一区| 国产精品久久久久一区二区三区| www.欧美日韩国产在线| 夜夜精品视频一区二区| 欧美精品丝袜中出| 高清beeg欧美| 亚洲影视在线观看| 精品噜噜噜噜久久久久久久久试看| 国产美女一区二区三区| 亚洲三级电影全部在线观看高清| 精品视频一区二区不卡| 国内久久婷婷综合| 亚洲欧美日韩中文字幕一区二区三区| 91丝袜美女网| 日本va欧美va精品发布| 国产精品入口麻豆原神| 欧美色欧美亚洲另类二区| 九九精品视频在线看| 一区免费观看视频| 欧美丰满一区二区免费视频| 国产精品一色哟哟哟| 午夜视频在线观看一区二区| 国产精品视频免费看| 7777精品久久久大香线蕉 | 午夜精品在线看| 久久久久久久久久久99999| 色视频一区二区| 久久9热精品视频| 一区二区三区蜜桃网| 欧美激情一区二区三区不卡 | 久久精品国产亚洲高清剧情介绍| 中文一区二区完整视频在线观看 | 蜜桃视频在线一区| 一区二区三区电影在线播| 久久久久久久久久久久久夜| 欧美日韩一区二区三区四区| 成人av免费网站| 国产高清精品网站| 蜜桃一区二区三区在线观看| 洋洋av久久久久久久一区| 精品日韩在线一区| 欧美日韩一区三区| 欧美体内she精高潮| av一本久道久久综合久久鬼色| 激情五月播播久久久精品| 午夜精品123| 亚洲成在人线免费| 亚洲一区二区综合| 亚洲精品水蜜桃| 亚洲色图在线播放| 亚洲欧洲精品一区二区精品久久久| 久久噜噜亚洲综合| 精品动漫一区二区三区在线观看| 欧美精品在线一区二区三区| 欧美午夜不卡视频| 99久久精品免费看| 99久久精品国产一区| 高清免费成人av| 成人性色生活片免费看爆迷你毛片| 激情综合网av| 狠狠色狠狠色合久久伊人| 紧缚捆绑精品一区二区| 麻豆精品精品国产自在97香蕉| 日韩电影一区二区三区| 日本欧美一区二区| 蜜臀av一级做a爰片久久| 老司机精品视频在线| 久久狠狠亚洲综合| 精品在线播放免费| 国产精品自在欧美一区| 国产盗摄一区二区| 不卡视频在线看| 91蜜桃婷婷狠狠久久综合9色| 91视频免费观看| 欧美性xxxxx极品少妇| 777午夜精品视频在线播放| 日韩一区国产二区欧美三区| 精品电影一区二区| 国产精品三级电影| 亚洲一级不卡视频| 免费成人av资源网| 国产高清不卡二三区| 波多野结衣亚洲一区| 欧美亚洲图片小说| 精品久久久久久久久久久久包黑料 | 欧美精品tushy高清| 91精品欧美福利在线观看| 日韩一本二本av| 久久先锋影音av鲁色资源网| 国产欧美日本一区二区三区| 亚洲色图制服丝袜| 日韩电影在线一区二区三区| 玖玖九九国产精品| 99久久精品国产毛片| 欧美精品日韩一本| 久久日一线二线三线suv| 中文在线一区二区 | 国产精品三级视频| 亚洲午夜精品17c| 精品亚洲国产成人av制服丝袜 | 久久综合999| 国产精品国产三级国产aⅴ入口| 夜夜爽夜夜爽精品视频| 九九热在线视频观看这里只有精品| 成人高清av在线| 7777精品久久久大香线蕉| 国产欧美日韩激情| 日日摸夜夜添夜夜添国产精品| 国产精品99久久久久| 欧美视频一区二区三区四区 | 欧美一区二区观看视频| 中文字幕欧美激情| 蜜臀精品久久久久久蜜臀| 成人av在线观| 欧美xingq一区二区| 亚洲男人天堂一区| 国产一区啦啦啦在线观看| 色婷婷综合久久久中文字幕| 精品少妇一区二区三区在线视频| 亚洲免费电影在线| 国产很黄免费观看久久| 在线不卡中文字幕播放| 亚洲日韩欧美一区二区在线| 国产一区二区在线影院| 欧美熟乱第一页| 国产精品麻豆视频| 国产乱人伦精品一区二区在线观看| 欧美日韩国产乱码电影| 国产精品成人在线观看 | 国产91清纯白嫩初高中在线观看| 欧美日韩日日骚| 一区精品在线播放| 国产精品亚洲综合一区在线观看| 欧美一区二区三区在线视频| 一级精品视频在线观看宜春院| 成人免费高清视频| 久久久久久久久久久久电影 | 久久久国产精品麻豆| 日韩高清在线观看| 欧美日韩精品电影| 亚洲综合激情另类小说区| 成人高清视频在线观看| 国产日韩精品一区二区三区在线| 日本aⅴ免费视频一区二区三区| 欧美三区在线观看| 亚洲一二三级电影| 欧美体内she精高潮| 亚洲二区在线视频| 欧美色视频在线| 亚洲bdsm女犯bdsm网站| 欧美日韩国产成人在线免费| 一区二区三区不卡视频在线观看| av网站免费线看精品| 国产精品美女一区二区| 成人开心网精品视频| 亚洲欧洲日韩综合一区二区| 成人国产精品免费观看动漫| 中文字幕在线观看不卡视频| 91一区二区在线| 一区二区三区欧美亚洲| 欧美日韩亚洲综合在线| 天使萌一区二区三区免费观看| 欧美日韩国产美| 免费看日韩a级影片| 日韩欧美国产精品一区| 国产一区二区福利视频| 国产日韩欧美激情| 99久久99久久精品国产片果冻| 综合久久一区二区三区| 欧美在线不卡视频| 日韩av成人高清| 日韩欧美一区二区视频| 国产激情视频一区二区三区欧美| 欧美激情艳妇裸体舞| 99久久综合国产精品| 亚洲国产综合人成综合网站| 91精品国产福利| 福利视频网站一区二区三区| 自拍偷自拍亚洲精品播放| 欧美视频一区二区三区在线观看| 日韩黄色小视频| 久久亚洲精精品中文字幕早川悠里| 高清不卡一二三区| 亚洲一区二区精品视频| 日韩欧美自拍偷拍| 成人小视频免费观看| 亚洲成在线观看| 国产女主播视频一区二区|