sqlÍêÈ«½âÎö
1¡¢¼òµ¥²éѯ
Çó³öÔÚ1988ÄêÒÔÇ°±»¹ÍÓ¶µÄÏúÊÛÈËÔ±
SELECT NAME
from SALESREPS
WHERE HIRE_DATE<'01-JAN-88'
ÁгöÆäÏúÊÛÁ¿µÍÓÚÏúÊÛÄ¿±êµÄ80%µÄÏúÊÛµã
SELECT CITY,SALES,TAGET
from SALESPEPS
WHERE SALES<0.8*TAGET
Ïà¹ØÎĵµ£º
1 Âß¼Êý¾Ý¿âºÍ±íµÄÉè¼Æ
Êý¾Ý¿âµÄÂß¼Éè¼Æ¡¢°üÀ¨±íÓë±íÖ®¼äµÄ¹ØϵÊÇÓÅ»¯¹ØϵÐÍÊý¾Ý¿âÐÔÄܵĺËÐÄ¡£Ò»¸öºÃµÄÂß¼Êý¾Ý¿âÉè¼Æ¿ÉÒÔΪ
ÓÅ»¯Êý¾Ý¿âºÍÓ¦ÓóÌÐò´òÏÂÁ¼ºÃµÄ»ù´¡¡£
±ê×¼»¯µÄÊý¾Ý¿âÂß¼Éè¼Æ°üÀ¨ÓöàµÄ¡¢ÓÐÏ໥¹ØϵµÄÕ±íÀ´´úÌæºÜ¶àÁеij¤Êý¾Ý±í¡£ÏÂÃæÊÇһЩʹÓñê×¼»¯
±íµÄһЩºÃ´¦¡£
A:ÓÉÓÚ±íÕ£¬Òò´Ë¿ÉÒÔʹŠ......
SQlÊý¾ÝÀàÐÍ(-_-ѧSQL¾Í´ÓÊý¾ÝÀàÐÍ¿ªÊ¼°É£¡)
bit ÕûÐÍ
ÆäÖµÖ»ÄÜÊÇ0¡¢1»ò¿ÕÖµ¡£
ÕâÖÖÊý¾ÝÀàÐÍÓÃÓÚ´æ´¢Ö»ÓÐÁ½ÖÖ¿ÉÄÜÖµµÄÊý¾Ý£¬ÈçYes »òNo¡¢True »òFalse ¡¢On »òOff.
int ÕûÐÍ 4¸ö×Ö½Ú
´Ó- 2^31(-2147483648)µ½2^31 (2147483 647)Ö®¼äµÄÕûÊý¡£
´æ´¢µ½Êý¾Ý¿âµÄ¼¸ºõËùÓÐÊýÖµÐ͵ÄÊý¾ ......
½ñÌìÓÃtime Like '2008-06-01%'Óï¾äÀ´²éѯ¸ÃÌìµÄËùÓÐÊý¾Ý£¬±»ÌáʾÓï¾ä´íÎó¡£²éÁËһϲŷ¢ÏÖ¸ÃÄ£ºý²éѯֻÄÜÓÃÓÚStringÀàÐ͵Ä×ֶΡ£
×Ô¼ºÒ²²éÔÄÁËһЩ×ÊÁÏ¡£¹ØÓÚʱ¼äµÄÄ£ºý²éѯÓÐÒÔÏÂÈýÖÖ·½·¨£º
1.Convertת³ÉString,ÔÚÓÃLike²éѯ¡£
select * from table1 where c ......
±àÂë¹ý³ÌÖÐÓöµ½µÄSQL·ÖÒ³Çé¿ö£¬×ܽ᣺
´ÓÊý¾Ý¿â±íÖеÚMÌõ¼Ç¼¿ªÊ¼¼ìË÷NÌõ¼Ç¼
MySQL£º
ÏȲéѯ·ÖÒ³£¬È»ºóÅÅÐò£º
select * from (select * from student limit 5,2) pageTable order by id desc ;
ÏÈÅÅÐò£¬È»ºó²éѯ·ÖÒ³£ºselect * from student order by id desc limit 5,2 ;
Oracle£º
SELECT * fro ......