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

Ìá¸ßSQLÖ´ÐÐЧÂʵļ¸µã½¨Òé

Ìá¸ßSQLÖ´ÐÐЧÂʵļ¸µã½¨Òé:
¡¡¡¡¡ô¾¡Á¿²»ÒªÔÚwhereÖаüº¬×Ó²éѯ;
¡¡¡¡¹ØÓÚʱ¼äµÄ²éѯ£¬¾¡Á¿²»ÒªÐ´³É£ºwhere to_char(dif_date,'yyyy-mm-dd')=to_char('2007-07-01','yyyy-mm-dd');
¡¡¡¡¡ôÔÚ¹ýÂËÌõ¼þÖУ¬¿ÉÒÔ¹ýÂ˵ô×î´óÊýÁ¿¼Ç¼µÄÌõ¼þ±ØÐë·ÅÔÚwhere×Ó¾äµÄĩβ;
¡¡¡¡from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í£¬driving table)½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ£¬Äã±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í¡£Èç¹ûÓÐÈý¸öÒÔÉϵÄÁ¬½Ó²éѯ£¬ÄǾÍÐèҪѡÔñ½»²æ±í(intersection table)×÷Ϊ»ù´¡±í£¬½»²æ±íÊÇÖ¸ÄǸö±»ÆäËû±íËùÒýÓõıí;
¡¡¡¡¡ô²ÉÓð󶨱äÁ¿
¡¡¡¡¡ôÔÚWHEREÖо¡Á¿²»ÒªÊ¹ÓÃOR
¡¡¡¡¡ôÓÃEXISTSÌæ´úIN¡¢ÓÃNOT EXISTSÌæ´úNOT IN;
¡¡¡¡¡ô±ÜÃâÔÚË÷ÒýÁÐÉÏʹÓüÆË㣺WHERE SAL*12>25000;
¡¡¡¡¡ôÓÃINÀ´Ìæ´úOR£º WHERE LOC_ID=10 OR LOC_ID=15 OR LOC_ID=20
¡¡¡¡¡ô±ÜÃâÔÚË÷ÒýÁÐÉÏʹÓÃIS NULLºÍIS NOT NULL;
¡¡¡¡¡ô×ÜÊÇʹÓÃË÷ÒýµÄµÚÒ»¸öÁÐ;
¡¡¡¡¡ôÓÃUNION-ALLÌæ´úUNION;
¡¡¡¡¡ô±ÜÃâ¸Ä±äË÷ÒýÁеÄÀàÐÍ£ºSELECT...from EMP WHERE EMPNO='123'£¬ÓÉÓÚÒþʽÊý¾ÝÀàÐÍת»»£¬to_char(EMPNO)='123'£¬Òò´Ë£¬½«²»²ÉÓÃË÷Òý£¬Ò»°ãÔÚ²ÉÓÃ×Ö·û´®Æ´´Õ¶¯Ì¬SQLÓï¾ä³öÏÖ;
¡¡¡¡¡ô'!=' ½«²»Ê¹ÓÃË÷Òý;
¡¡¡¡¡ôÓÅ»¯GROUP BY;
¡¡¡¡¡ô±ÜÃâ´øÓÐLIKE²ÎÊýµÄͨÅä·û£¬LIKE '4YE%'ʹÓÃË÷Òý£¬µ«LIKE '%YE'²»Ê¹ÓÃË÷Òý
¡¡¡¡¡ô±ÜÃâʹÓÃÀ§ÄѵÄÕý¹æ±í´ïʽ£¬ÀýÈçselect * from customer where zipcode like "98___"£¬¼´±ãÔÚzipcodeÉϽ¨Á¢ÁËË÷Òý£¬ÔÚÕâÖÖÇé¿öÏÂÒ²»¹ÊDzÉÓÃ˳ÐòɨÃèµÄ·½Ê½¡£Èç¹û°ÑÓï¾ä¸Ä³Éselect * from customer where zipcode>"98000"£¬ÔÚÖ´Ðвéѯʱ¾Í»áÀûÓÃË÷ÒýÀ´²éѯ£¬ÏÔÈ»»á´ó´óÌá¸ßËÙ¶È;
¡¡¡¡¡ô¾¡Á¿Ã÷È·µÄÍê³ÉSQLÓï¾ä£¬¾¡Á¿ÉÙÈÃÊý¾Ý¿â¹¤×÷¡£±ÈÈçдSELECTÓï¾äʱ£¬ÐèÒª°Ñ²éѯµÄ×Ö¶ÎÃ÷È·Ö¸³ö±íÃû¡£¾¡Á¿²»ÒªÊ¹ÓÃSELECT *Óï¾ä¡£×éÖ¯SQLÓï¾äµÄʱºò£¬¾¡Á¿°´ÕÕÊý¾Ý¿âµÄÏ°¹ß½øÐÐ×éÖ¯


Ïà¹ØÎĵµ£º

SQL»ù´¡

##   ɾ³ýÊý¾Ý¿â
drop  database  ecport;
##   ´´½¨Êý¾Ý¿â
create   database   ecport;
##   ʹÓÃÊý¾Ý¿â
use   ecport;

##   ¹ú¼Ò±í½á¹¹
create   table COUNTRY(
     &nbs ......

javaÖÐÈçºÎÒÔwindows¼¯³É·½Ê½Á¬½ÓSQL Server

ÔÚ¡¶JDBC Driver For SQL2000/2005/2008
¡·Ò»ÎÄÖУ¬ÑûÔ½éÉÜÁËÈçºÎÏÂÔز¢Ê¹ÓÃjdbcÁ¬½ÓSQL Server,
½ñÌìÓÐÈËÎÊÆð£¬ÈçºÎÒÔwindows¼¯³É·½Ê½Á¬½ÓSQL Server,Õâ¸öÒÔÇ°ÕæûÊÔ¹ý¡£
ÓÚÊÇ£¬´ò¿ªnetBeans²âÊÔÁËһϣ¬´úÂëÈçÏ£º
/*
* To change this template, choose Tools | Templates
* and open the template in the edit ......

SQL 2005 tips

USE tempdb
GO
CREATE TABLE AuctionItems
(
  itemid       INT          NOT NULL PRIMARY KEY NONCLUSTERED,
  itemtype     NVARCHAR(30) NOT NULL,
  whenmade     INT&nb ......

¶¨Ê±ÖØÆôSQL ServerºÍTomcat

¶¨Ê±ÖØÆôSQL ServerºÍTomcat
[http://hi.baidu.com/personnel/blog/item/020d5edf020a281248540306.html]
¶¨Ê±ÖØÆôSQL ServerºÍTomcat
2007-06-07 08:23
ÒÔǰûÓÐ×Ô¼º¹ÜÀí·þÎñÆ÷»¹²»ÖªµÀ£¬SQL Server·þÎñÆ÷µÄÄÚ´æËæ×ÅÔËÐеÄʱ¼äÔö³¤¶ø²»¶ÏÔö³¤¡£
ÓÃÁËÒ»Á½ÌìÖ®ºó·¢ÏÖ½ø³ÌÖеÄSQL ServerÒѾ­Õ¼ÓÃÁ˽ü1.3GµÄÄڴ棬ÄÚ´æÒ»¹ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ