Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL learning

Five basic search conditions are summarized here:
1) Comparison test
2) Range test
3) Set membership test
4) Pattern matching test (Like)
     The pattern matching test checks to see whether the data value in a column matches a specified pattern
   % mathes any sequence of zero or more characters.
   _ matches any single character.
// Find products whose product IDs start with the four letters "A%BC"
      SELECT order_num ,product
       from orders
      WHERE product LIKE 'A$%BC' ESCAPE '$' ;
5) Null value test (IS NULL)
In SQL's  three-valued logic, a search condition can yield a TRUE,FALSE, or NULL result. Only rows where search codition yields a TRUE result are included in the query result.
Rules For Single-Table Query Processing
The from clause is applied first; the where clause is applied next ; the SELECT clause is applied next . Finally, the
ORDER BY clause is applied to sort the query results.


Ïà¹ØÎĵµ£º

ʹÓÃoracleµÄ10046ʼþ¸ú×ÙSQLÓï¾ä

Ô­ÎĵØÖ·£ºhttp://www.blogjava.net/xingcyx/archive/2007/01/09/92638.html
ʹÓÃoracleµÄ10046ʼþ¸ú×ÙSQLÓï¾ä
ÎÒÃÇÔÚ·ÖÎöÓ¦ÓóÌÐòÐÔÄÜÎÊÌâµÄʱºò£¬¸ü¶àµØÐèÒª¹Ø×¢ÆäÖÐSQLÓï¾äµÄÖ´ÐÐÇé¿ö£¬ÒòΪͨ³£Ó¦ÓóÌÐòµÄÐÔÄÜÆ¿¾±»áÔÚÊý¾Ý¿âÕâ±ß£¬Òò´ËÊý¾Ý¿âµÄsqlÓï¾äÊÇÎÒÃÇÓÅ»¯µÄÖØµã¡£ÀûÓÃOracleµÄ10046ʼþ£¬¿ÉÒÔ¸ú×ÙÓ¦ÓóÌÐòËùÖ´ ......

ORACLE SQLÓÅ»¯

ORACLE SQLÓÅ»¯
£¨1£© Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£º
ORACLE µÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom ×Ó¾äÖеıíÃû£¬from ×Ó¾äÖÐдÔÚ×îºóµÄ±í
(»ù´¡±ídriving table)½«±»×îÏÈ´¦Àí£¬ÔÚfrom ×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏÂ,Äã±ØÐëÑ¡Ôñ¼Ç
¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í¡£Èç¹ûÓÐ3¸öÒÔÉϵıíÁ¬½Ó²éѯ, ÄǾÍÐè ......

×î½üµÄÁ½ÌõsqlЧÂÊÓÅ»¯ÐĵÃ

µÚÒ»Ìõ£º
select * from where field in (1,2,3)   ÕâÖÖд·¨Ó¦¸ÃÉáÆúÁË£¬¶øÓ¦¸ÃÕâÑùд£º
select * from table where field = 1 or field = 2 or field = 3 
ÎªÊ²Ã´ÄØ£¿
·²ÊÂÖ»ÓÐ×ö¹ý²ÅÖªµÀ£¬×Ô¼º½¨¸ö±í£¬²åÈë10WÌõ²âÊÔÊý¾Ý£¬ÓÃsql²âÊÔһϱãÖª£¬ÒòΪ¹¤×÷±ãÀû£¬ÎÒÔÚ²úÆ·»úºÍÍâÍø²âÊÔ»ú¶¼ÒѾ­²âÊÔ¹ý£ ......

oracle sql ÇóÖÖ²Ëʱ¼ä

-- create by zh
-- n ÊÇ×÷ÎïµÄʱ¼ä,x ÊÇÏ£ÍûÔÚ¼¸µã³ÉÊì,·µ»Ø²¥ÖÖµÄʱ¼ä
with t as
(
select 64 n,9 x from dual union all
select 64 n,13 x from dual union all
select 64 n,17 x from dual union all
select 64 n,20 x from dual
)
select '³ÉÊìʱ¼ä:'     || lpad(to_char(n),4,' ' ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ