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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch21.htm

?? Learn SQL in an easy way...
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD>		<TITLE>Teach Yourself SQL in 21 Days, Second Edition -- Ch 21 -- Common SQL Mistakes/Errors and Resolutions</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><CENTER><H1><IMG SRC="../buttonart/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR><FONT COLOR="#000077">Teach Yourself SQL in 21 Days, Second Edition</FONT></H1></CENTER><CENTER><P><A HREF="../ch20/ch20.htm"><IMG SRC="../buttonart/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../wk3rev/wk3rev.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> <HR></CENTER><CENTER><H1><FONT COLOR="#000077">- Day 21 -<BR><BR>Common SQL Mistakes/Errors and Resolutions</FONT></H1></CENTER><H2><FONT COLOR="#000077">Objectives</FONT></H2><P>Welcome to Day 21. By the end of today, you will have become familiar with thefollowing:<UL>	<LI>Several typical errors and their resolutions	<P>	<LI>Common logical shortcomings of SQL users	<P>	<LI>Ways to prevent daily setbacks caused by errors</UL><H2><FONT COLOR="#000077">Introduction</FONT></H2><P>Today you will see various common errors that everyone--from novice to pro--makeswhen using SQL. You will never be able to avoid all errors and/or mistakes, but beingfamiliar with a wide range of errors will help you resolve them in as short a timeas possible.<BLOCKQUOTE>	<P><HR><FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>We used Personal Oracle7 for our	examples. Your particular implementation will be very similar in the type of error,	but could differ in the numbering or naming of the error. We ran our SQL statements	using SQL*PLUS and set <TT>ECHO</TT> and <TT>FEEDBACK</TT> to <TT>on</TT> to see	the statement. <HR></BLOCKQUOTE><P>Keep in mind that some mistakes will actually yield error messages, whereas othersmay just be inadequacies in logic that will inevitably cause more significant errorsor problems down the road. With a strict sense of attention to detail, you can avoidmost problems, although you will always find yourself stumbling upon errors.<H2><FONT COLOR="#000077">Common Errors</FONT></H2><P>This section describes many common errors that you will receive while executingall types of SQL statements. Most are simple and make you want to kick yourself onthe hind side, whereas other seemingly obvious errors are misleading.<H3><FONT COLOR="#000077">Table or View Does Not Exist</FONT></H3><P>When you receive an error stating that the table you are trying to access doesnot exist, it seems obvious; for example:</P><H5>INPUT:</H5><PRE><FONT COLOR="#0066FF">SQL&gt; <B>@tables.sql</B></FONT></PRE><H5><FONT COLOR="#000000">OUTPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; spool tables.lstSQL&gt; set echo onSQL&gt; set feedback onSQL&gt; set pagesize 1000SQL&gt; select owner|| '.' || table_name   2  from sys.dba_table   3  where owner = 'SYSTEM'   4  order by table_name   5  /       from sys.dba_table      *ERROR at line 2:ORA-00942: table or view does not exist SQL&gt; spool off SQL&gt;</FONT></PRE><H5>ANALYSIS:</H5><P>Notice the asterisk below the word <TT>table</TT>. The correct table name is <TT>sys.dba_tables</TT>.An s was omitted from the table name.</P><P>But what if you know the table exists and you still receive this error? Sometimeswhen you receive this error, the table does in fact exist, but there may be a securityproblem--that is, the table exists, but you do not have access to it. This errorcan also be the database server's way of saying nicely, &quot;You don't have permissionto access this table!&quot;<BLOCKQUOTE>	<P><HR><FONT COLOR="#000077"><B>TIP:</B></FONT><B> </B>Before you allow panic to set in,	immediately verify whether or not the table exists using a DBA account, if available,	or the schema account. You will often find that the table does exist and that the	user lacks the appropriate privileges to access it. <HR></BLOCKQUOTE><H3><FONT COLOR="#000077">Invalid Username or Password</FONT></H3><H5><FONT COLOR="#000000">INPUT:</FONT></H5><PRE><FONT COLOR="#0066FF"> SQL*Plus: Release 3.2.3.0.0 - on Sat May 10 11:15:35 1997Copyright (c) Oracle Corporation 1979, 1994.  All rights reserved.Enter user-name: <B>rplew</B>Enter password:</FONT></PRE><H5><FONT COLOR="#000000">OUTPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">ERROR: ORA-01017: invalid username/password; logon deniedEnter user-name:</FONT></PRE><P>This error was caused either by entering the incorrect username or the incorrectpassword. Try again. If unsuccessful, have your password reset. If you are sure thatyou typed in the correct username and password, then make sure that you are attemptingto connect to the correct database if you have access to more than one database.<H3><FONT COLOR="#000077">FROM Keyword Not Specified</FONT></H3><H5><FONT COLOR="#000000">INPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; <B>@tblspc.sql</B></FONT></PRE><H5><FONT COLOR="#000000">OUTPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; spool tblspc.lstSQL&gt; set echo onSQL&gt; set feedback onSQL&gt; set pagesize 1000SQL&gt; select substr(tablespace_name,1,15) a,  2         substrfile_name, 1,45) c, bytes  3  from sys.dba_data_files  4  order by tablespace_name;     substrfile_name, 1,45) c, bytes     *ERROR at line 2:ORA-00923: FROM keyword not found where expectedSQL&gt; spool offSQL&gt;</FONT></PRE><H5>ANALYSIS:</H5><P>This error can be misleading. The keyword <TT>FROM</TT> is there, but you aremissing a left parenthesis between <TT>substr</TT> and <TT>file_name</TT> on line2. This error can also be caused by a missing comma between column names in the <TT>SELECT</TT>statement. If a column in the <TT>SELECT</TT> statement is not followed by a comma,the query processor automatically looks for the <TT>FROM</TT> keyword. The previousstatement has been corrected as follows:</P><PRE><FONT COLOR="#0066FF">SQL&gt; <B>select substr(tablespace_name,1,15) a,</B>  2        <B> substr(file_name,1,45) c, bytes</B>  3 <B> from sys.dba_data_files</B>  4  <B>order by tablespace_name;</B></FONT></PRE><H3><FONT COLOR="#000077">Group Function Is Not Allowed Here</FONT></H3><H5><FONT COLOR="#000000">INPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; <B>select count(last_name), first_name, phone_number</B>  2  <B>from employee_tbl</B>  3  <B>group by count(last_name), first_name, phone_number</B>  4 <B> /</B></FONT></PRE><H5><FONT COLOR="#000000">OUTPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">     group by count(last_name), first_name, phone_number           *ERROR at line 3:ORA-00934: group function is not allowed hereSQL&gt;</FONT></PRE><H5>ANALYSIS:</H5><P>As with any group function, <TT>COUNT</TT> may not be used in the <TT>GROUP BY</TT>clause. You can list only column and nongroup functions, such as <TT>SUBSTR</TT>,in the <TT>GROUP BY</TT> clause.<BLOCKQUOTE>	<P><HR><FONT COLOR="#000077"><B>TIP:</B></FONT><TT><B> </B>COUNT</TT> is a function that	is being performed on groups in the query. <HR></BLOCKQUOTE><P>The previous statement has been corrected using the proper syntax:</P><PRE><FONT COLOR="#0066FF">SQL&gt; <B>select count(last_name), first_name, phone_number</B>  2  <B>from employee_tbl</B>  3  <B>group by last_name, first_name, phone_number;</B></FONT></PRE><H3><FONT COLOR="#000077">Invalid Column Name</FONT></H3><H5><FONT COLOR="#000000">INPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; <B>@tables.sql</B></FONT></PRE><H5><FONT COLOR="#000000">OUTPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; spool tables.lstSQL&gt; set echo onSQL&gt; set feedback onSQL&gt; set pagesize 1000SQL&gt; select owner|| '.' || tablename  2  from sys.dba_tables  3  where owner = 'SYSTEM'  4  order by table_name  5  /     select owner|| '.' || tablename                  *ERROR at line 1:ORA-00904: invalid column nameSQL&gt; spool offSQL&gt;</FONT></PRE><H5>ANALYSIS:</H5><P>In line 1 the column <TT>tablename</TT> is incorrect. The correct column nameis <TT>table_name</TT>. The underscore was omitted. To see the correct columns, usethe <TT>DESCRIBE</TT> command. This error can also occur when trying to qualify acolumn in the <TT>SELECT</TT> statement by the wrong table name.<H3><FONT COLOR="#000077">Missing Keyword</FONT></H3><H5><FONT COLOR="#000000">INPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; create view emp_view  2  select * from employee_tbl  3  /</FONT></PRE><H5><FONT COLOR="#000000">OUTPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">     select * from employee_tbl     *ERROR at line 2:ORA-00905: missing keywordSQL&gt;</FONT></PRE><H5>ANALYSIS:</H5><P>Here the syntax is incorrect. This error occurs when you omit a mandatory wordwith any given command syntax. If you are using an optional part of the command,that option may require a certain keyword. The missing keyword in this example is<TT>as</TT>. The statement should look like this:</P><PRE><FONT COLOR="#0066FF">SQL&gt; <B>create view emp_view as</B>  2 <B>select * from employee_tbl</B>  3 <B>/</B></FONT></PRE><H3><FONT COLOR="#000077">Missing Left Parenthesis</FONT></H3><H5><FONT COLOR="#000000">INPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; <B>@insert.sql</B></FONT></PRE><H5><FONT COLOR="#000000">OUTPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; insert into people_tbl values  2  '303785523', 'SMITH', 'JOHN', 'JAY', 'MALE', '10-JAN-50')  3  /     '303785523', 'SMITH', 'JOHN', 'JAY', 'MALE', '10-JAN-50')     *  ERROR at line 2:  ORA-00906: missing left parenthesisSQL&gt;</FONT></PRE><H5>ANALYSIS:</H5><P>On line 2 a parenthesis does not appear before the Social Security number. Thecorrect syntax should look like this:</P><PRE><FONT COLOR="#0066FF">SQL&gt; <B>insert into people_tbl values</B>  2 <B>('303785523', 'SMITH', 'JOHN', 'JAY', 'MALE', '10-JAN-50')</B>  3 <B>/</B></FONT></PRE><H3><FONT COLOR="#000077">Missing Right Parenthesis</FONT></H3><H5><FONT COLOR="#000000">INPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; <B>@tblspc.sql</B></FONT></PRE><H5><FONT COLOR="#000000">OUTPUT:</FONT></H5><PRE><FONT COLOR="#0066FF">SQL&gt; spool tblspc.lstSQL&gt; set echo onSQL&gt; set feedback onSQL&gt; set pagesize 1000SQL&gt; select substr(tablespace_name,1,15 a,  2         substr(file_name, 1,45) c, bytes  3  from sys.dba_data_files  4  order by tablespace_name;     select substr(tablespace_name,1,15 a,                     *ERROR at line 1:ORA-00907: missing right parenthesisSQL&gt; spool offSQL&gt;</FONT></PRE><H5>ANALYSIS:</H5><P>On line 1 the right parenthesis is missing from the <TT>substr</TT>. The correctsyntax looks like this:</P><PRE><FONT COLOR="#0066FF">  SQL&gt; <B>select substr(tablespace_name,1,15) a,</B>    2       <B>  substr(file_name,1,45) c, bytes</B>    3 <B> from sys.dba_data_files</B>    4  <B>order by tablespace_name;</B></FONT></PRE><H3><FONT COLOR="#000077">Missing Comma</FONT></H3><H5><FONT COLOR="#000000">INPUT:</FONT></H5>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美另类综合偷拍| 另类欧美日韩国产在线| 天天色综合天天| 国产一区二区三区综合| 欧美人牲a欧美精品| 国产精品麻豆99久久久久久| 天天射综合影视| 一本色道久久加勒比精品| 日韩一级在线观看| 一区二区三区在线视频播放 | 欧美精品一区二区久久婷婷| 亚洲欧美韩国综合色| 狠狠久久亚洲欧美| 欧美岛国在线观看| 亚洲成人先锋电影| 欧美在线一区二区三区| 国产精品狼人久久影院观看方式| 蜜桃精品视频在线| 欧美精品黑人性xxxx| 亚洲精品乱码久久久久久久久| 国产成人av网站| 久久综合色鬼综合色| 久久国产精品99久久人人澡| 欧美日韩免费电影| 香蕉乱码成人久久天堂爱免费| 91香蕉视频黄| 国产精品传媒视频| 色偷偷一区二区三区| 中文字幕在线不卡一区| av成人老司机| 亚洲天天做日日做天天谢日日欢| av成人动漫在线观看| 国产精品麻豆99久久久久久| 成人午夜精品一区二区三区| 欧美国产精品中文字幕| 国产一区二区看久久| 国产日韩三级在线| 懂色av一区二区夜夜嗨| 亚洲国产高清不卡| 不卡一区二区三区四区| 中文字幕亚洲区| 色综合久久久久综合| 亚洲综合丁香婷婷六月香| 91国产视频在线观看| 午夜精品影院在线观看| 欧美一级高清片在线观看| 国内欧美视频一区二区| 国产精品色婷婷| 欧美剧情电影在线观看完整版免费励志电影| 欧美韩国一区二区| 91激情五月电影| 亚洲成人av电影| 精品国产免费人成在线观看| 国产成人综合自拍| 最新欧美精品一区二区三区| 欧美女孩性生活视频| 秋霞影院一区二区| 中文文精品字幕一区二区| 色婷婷综合久久久久中文 | 亚洲精品亚洲人成人网| 欧美日本一区二区| 国内精品不卡在线| 日韩美女精品在线| 日韩免费在线观看| 成人av在线影院| 亚洲高清久久久| 国产亚洲精品福利| 欧美性大战久久久久久久| 精品在线你懂的| 中文字幕一区二区三区精华液| 欧美高清www午色夜在线视频| 韩国精品在线观看| 亚洲一区二区精品视频| 国产午夜亚洲精品不卡| 色偷偷成人一区二区三区91| 裸体在线国模精品偷拍| 亚洲精品午夜久久久| 欧美精品一区二区蜜臀亚洲| 欧美天堂亚洲电影院在线播放| 蜜臀av在线播放一区二区三区| 中文字幕一区二区三区不卡| 欧美成人精精品一区二区频| 在线国产亚洲欧美| 国产成人午夜99999| 亚洲123区在线观看| 国产精品色在线| 久久亚洲捆绑美女| 欧美精品18+| 色婷婷亚洲综合| 国产99久久久国产精品| 久久精品国产亚洲高清剧情介绍| 亚洲精品国产视频| 欧美激情一区二区三区全黄| 日韩亚洲欧美成人一区| 欧洲av一区二区嗯嗯嗯啊| 成人sese在线| 国产一区二区三区香蕉 | 亚洲精品乱码久久久久久| 国产丝袜欧美中文另类| 日韩免费看网站| 欧美一二区视频| 51精品秘密在线观看| 欧美综合亚洲图片综合区| 国产成人精品综合在线观看| 国产综合色产在线精品 | 亚洲国产视频直播| 亚洲天堂2014| 亚洲欧美日韩国产手机在线| 中文字幕av一区二区三区免费看| 26uuu国产电影一区二区| 日韩精品中文字幕在线一区| 日韩一区二区免费在线电影| 欧美精品电影在线播放| 欧美伦理视频网站| 91精品国产综合久久婷婷香蕉 | 91麻豆免费观看| 91美女蜜桃在线| 在线精品视频免费播放| 欧美色老头old∨ideo| 欧美性一二三区| 欧美亚洲动漫精品| 欧美日韩成人激情| 欧美一二区视频| 久久精品欧美日韩精品 | 久久一留热品黄| 欧美国产禁国产网站cc| 国产精品久久久久久久第一福利 | 精品国免费一区二区三区| 日韩欧美另类在线| 日本一区免费视频| 一区在线观看视频| 亚洲国产精品久久不卡毛片| 五月婷婷激情综合网| 蜜臀av性久久久久av蜜臀妖精 | 日韩国产一区二| 九九九精品视频| 成人av电影免费在线播放| 91丨porny丨国产入口| 欧美精品在线观看一区二区| 91精品国产综合久久国产大片| 精品国产亚洲一区二区三区在线观看 | 亚洲色图.com| 五月婷婷激情综合网| 国内精品伊人久久久久av一坑| 成人黄色综合网站| 制服丝袜中文字幕一区| 欧美精品一区二区久久久| 国产精品国产精品国产专区不蜜 | 欧美日韩中文精品| 精品国产青草久久久久福利| 中文字幕一区日韩精品欧美| 亚洲成va人在线观看| 国产一区二区三区在线看麻豆 | 成人免费av网站| 欧美日韩国产中文| 国产午夜亚洲精品午夜鲁丝片| 亚洲一区成人在线| 国产一区二区日韩精品| 91国产精品成人| 日本一区二区免费在线| 亚洲成在线观看| 国产成人鲁色资源国产91色综| 欧美视频一区二区三区在线观看| 精品国产伦一区二区三区观看体验| 亚洲精品高清在线| 国产精品一区久久久久| 欧美另类变人与禽xxxxx| 国产欧美日韩精品在线| 婷婷六月综合网| 日本久久精品电影| 国产网站一区二区| 日本一区中文字幕| 欧美午夜精品一区| 国产精品白丝在线| 国内外成人在线| 日韩午夜激情免费电影| 亚洲丶国产丶欧美一区二区三区| 粉嫩在线一区二区三区视频| 欧美电影精品一区二区 | 成人欧美一区二区三区1314| 毛片av一区二区| 6080yy午夜一二三区久久| 亚洲精品欧美综合四区| 成人午夜又粗又硬又大| 久久久精品日韩欧美| 蜜桃av噜噜一区| 欧美二区三区的天堂| 一区二区三区中文在线| 91片黄在线观看| 亚洲欧洲精品一区二区三区不卡| 国产麻豆精品在线观看| 欧美成人一区二区三区片免费 | av在线播放不卡| 日本一区二区三区四区 | 欧美亚洲丝袜传媒另类| 一区二区三区在线影院| 在线视频一区二区三| 一区二区三区四区在线播放| 一本大道久久a久久综合婷婷| 国产精品久久久久久久第一福利 |