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

SqlÁ¬½Ó²éѯºÍÁªºÏ²éѯ


SqlÁ¬½Ó²éѯºÍÁªºÏ²éѯ
Á¬½Ó²éѯ
   ͨ¹ýÁ¬½ÓÔËËã·û¿ÉÒÔʵÏÖ¶à¸ö±í²éѯ¡£Á¬½ÓÊǹØϵÊý¾Ý¿âÄ£Ð͵ÄÖ÷ÒªÌص㣬ҲÊÇËüÇø±ðÓÚÆäËüÀàÐÍÊý¾Ý¿â¹ÜÀíϵͳµÄÒ»¸ö±êÖ¾¡£
   ÔÚ¹ØϵÊý¾Ý¿â¹ÜÀíϵͳÖУ¬±í½¨Á¢Ê±¸÷Êý¾ÝÖ®¼äµÄ¹Øϵ²»±ØÈ·¶¨£¬³£°ÑÒ»¸öʵÌåµÄËùÓÐÐÅÏ¢´æ·ÅÔÚÒ»¸ö±íÖС£µ±¼ìË÷Êý¾Ýʱ£¬Í¨¹ýÁ¬½Ó²Ù×÷²éѯ³ö´æ·ÅÔÚ¶à¸ö±íÖеIJ»Í¬ÊµÌåµÄÐÅÏ¢¡£Á¬½Ó²Ù×÷¸øÓû§´øÀ´ºÜ´óµÄÁé»îÐÔ£¬ËûÃÇ¿ÉÒÔÔÚÈκÎʱºòÔö¼ÓеÄÊý¾ÝÀàÐÍ¡£Îª²»Í¬ÊµÌå´´½¨ÐÂµÄ±í£¬¶ûºóͨ¹ýÁ¬½Ó½øÐвéѯ¡£
   Á¬½Ó¿ÉÒÔÔÚSELECT Óï¾äµÄfrom×Ó¾ä»òWHERE×Ó¾äÖн¨Á¢£¬ËÆÊǶø·ÇÔÚfrom×Ó¾äÖÐÖ¸³öÁ¬½ÓʱÓÐÖúÓÚ½«Á¬½Ó²Ù×÷ÓëWHERE×Ó¾äÖеÄËÑË÷Ìõ¼þÇø·Ö¿ªÀ´¡£ËùÒÔ£¬ÔÚTransact-SQLÖÐÍƼöʹÓÃÕâÖÖ·½·¨¡£
   SQL-92±ê×¼Ëù¶¨ÒåµÄfrom×Ó¾äµÄÁ¬½ÓÓï·¨¸ñʽΪ£º
from join_table join_type join_table
[ON (join_condition)]
ÆäÖÐjoin_tableÖ¸³ö²ÎÓëÁ¬½Ó²Ù×÷µÄ±íÃû£¬Á¬½Ó¿ÉÒÔ¶Ôͬһ¸ö±í²Ù×÷£¬Ò²¿ÉÒÔ¶Ô¶à±í²Ù×÷£¬¶Ôͬһ¸ö±í²Ù×÷µÄÁ¬½ÓÓÖ³Æ×ö×ÔÁ¬½Ó¡£
join_type Ö¸³öÁ¬½ÓÀàÐÍ£¬¿É·ÖΪÈýÖÖ£ºÄÚÁ¬½Ó¡¢ÍâÁ¬½ÓºÍ½»²æÁ¬½Ó¡£ÄÚÁ¬½Ó(INNER JOIN)ʹÓñȽÏÔËËã·û½øÐбí¼äij(Щ)ÁÐÊý¾ÝµÄ±È½Ï²Ù×÷£¬²¢ÁгöÕâЩ±íÖÐÓëÁ¬½ÓÌõ¼þÏàÆ¥ÅäµÄÊý¾ÝÐС£¸ù¾ÝËùʹÓõıȽϷ½Ê½²»Í¬£¬ÄÚÁ¬½ÓÓÖ·ÖΪµÈÖµÁ¬½Ó¡¢×ÔÈ»Á¬½ÓºÍ²»µÈÁ¬½ÓÈýÖÖ¡£
ÍâÁ¬½Ó·ÖΪ×óÍâÁ¬½Ó(LEFT OUTER JOIN»òLEFT JOIN)¡¢ÓÒÍâÁ¬½Ó(RIGHT OUTER JOIN»òRIGHT JOIN)ºÍÈ«ÍâÁ¬½Ó(FULL OUTER JOIN»òFULL JOIN)ÈýÖÖ¡£ÓëÄÚÁ¬½Ó²»Í¬µÄÊÇ£¬ÍâÁ¬½Ó²»Ö»ÁгöÓëÁ¬½ÓÌõ¼þÏàÆ¥ÅäµÄÐУ¬¶øÊÇÁгö×ó±í(×óÍâÁ¬½Óʱ)¡¢ÓÒ±í(ÓÒÍâÁ¬½Óʱ)»òÁ½¸ö±í(È«ÍâÁ¬½Óʱ)ÖÐËùÓзûºÏËÑË÷Ìõ¼þµÄÊý¾ÝÐС£
½»²æÁ¬½Ó(CROSS JOIN)ûÓÐWHERE ×Ӿ䣬Ëü·µ»ØÁ¬½Ó±íÖÐËùÓÐÊý¾ÝÐеĵѿ¨¶û»ý£¬Æä½á¹û¼¯ºÏÖеÄÊý¾ÝÐÐÊýµÈÓÚµÚÒ»¸ö±íÖзûºÏ²éѯÌõ¼þµÄÊý¾ÝÐÐÊý³ËÒÔµÚ¶þ¸ö±íÖзûºÏ²éѯÌõ¼þµÄÊý¾ÝÐÐÊý¡£
Á¬½Ó²Ù×÷ÖеÄON (join_condition) ×Ó¾äÖ¸³öÁ¬½ÓÌõ¼þ£¬ËüÓɱ»Á¬½Ó±íÖеÄÁкͱȽÏÔËËã·û¡¢Âß¼­ÔËËã·ûµÈ¹¹³É¡£
ÎÞÂÛÄÄÖÖÁ¬½Ó¶¼²»ÄܶÔtext¡¢ntextºÍimageÊý¾ÝÀàÐÍÁнøÐÐÖ±½ÓÁ¬½Ó£¬µ«¿ÉÒÔ¶ÔÕâÈýÖÖÁнøÐмä½ÓÁ¬½Ó¡£ÀýÈ磺
SELECT p1.pub_id,p2.pub_id,p1.pr_info
from pub_info AS p1 INNER JOIN pub_info AS p2
ON DATALENGTH(p1.pr_info)=DATALENGTH(p2.pr_info)
(Ò»)ÄÚÁ¬½Ó
ÄÚÁ¬½Ó²éѯ²Ù×÷ÁгöÓëÁ¬½ÓÌõ¼þÆ¥ÅäµÄÊý¾ÝÐУ¬ËüʹÓñȽÏÔËËã·û±È½Ï±»Á¬½ÓÁеÄÁÐÖµ¡£


Ïà¹ØÎĵµ£º

´ò¿ªSqlÊý¾Ý¿âÎļþ£¨À©Õ¹ÃûΪmdf£©

ºó׺ÃûΪ.mdfµÄsqlÊý¾Ý¿âÈçºÎ´ò¿ª£¿
ÓÐ.mdfºÍ.ldfÁ½¸öÎļþ£¬´ò¿ª·½°¸£º
·½·¨Ò»£ºÔÚSql serverÆóÒµ¹ÜÀíÆ÷ÖÐ   -   Êý¾Ý¿â   - ÓÒ¼ü <¸½¼ÓÊý¾Ý¿â
 ·½·¨¶þ£ºÔÚVS2005ÖÐÏȽ¨Á¢Ò»¸öÓëÄãÒª´ò¿ªµÄmdfÎļþͬÃûµÄÊý¾Ý¿â£¬¼Çס´æ´¢Î»Öã¬È»ºóÓÃÄãÒª´ò¿ªµÄmdfÎļþ½«¸Õ½¨Á¢µÄmdfÊý¾Ý¿âÎļþÌæ»»¼´¿É¡£ ......

SQL Á¬½Ó²éѯ£¨ÄÚÁ´½Ó ÍâÁ¬½Ó£©


Á¬½Ó²éѯ 
¡¡¡¡Í¨¹ýÁ¬½ÓÔËËã·û¿ÉÒÔʵÏÖ¶à¸ö±í²éѯ¡£Á¬½ÓÊǹØϵÊý¾Ý¿âÄ£Ð͵ÄÖ÷ÒªÌص㣬ҲÊÇËüÇø±ðÓÚÆäËüÀàÐÍÊý¾Ý¿â¹ÜÀíϵͳµÄÒ»¸ö±êÖ¾¡£ 
¡¡¡¡ÔÚ¹ØϵÊý¾Ý¿â¹ÜÀíϵͳÖУ¬±í½¨Á¢Ê±¸÷Êý¾ÝÖ®¼äµÄ¹Øϵ²»±ØÈ·¶¨£¬³£°ÑÒ»¸öʵÌåµÄËùÓÐÐÅÏ¢´æ·ÅÔÚÒ»¸ö±íÖС£µ±¼ìË÷Êý¾Ýʱ£¬Í¨¹ýÁ¬½Ó²Ù×÷²éѯ³ö´æ·ÅÔÚ¶à¸ö±íÖеIJ»Í¬ÊµÌåµÄ ......

EditPlus(v2.21)µÄSQLÓï·¨Îļþ

ÏÂÔصØÖ·£ºhttp://submain.download.csdn.net/
Ò²¿ÉÒÔÖ±½Ó¸´ÖÆÏÂÃæµÄÄÚÈÝ£¬²¢±£´æÎļþΪ“sql.stx”¡£
#TITLE=SQL
; SQL syntax file written by BUGSoft(BUGSoft@126.com).
#DELIMITER=,(){}[]-+*%/="'~!&|<>?:;.
#QUOTATION1='
#QUOTATION2="
#LINECOMMENT=--
#COMMENTON=/*
#COMMENTOFF=*/ ......

̽ÌÖPHP SQL×¢ÈëµÄ½â¾ö˼·

˼·:SQLÀᄀ¿ÉÄܵIJÉÓÃÁ½¸öÒýºÅ±ÕºÏ±äÁ¿;¶Ô±äÁ¿ÖеÄÒýºÅתÒå;¶Ô²»ÄܲÉÓÃ2¸öÒýºÅ±ÕºÏµÄ±äÁ¿,ÏÈÔ¤ÏÈÅжϱäÁ¿ÀàÐÍ;  
   
  ·½°¸:  
  1   ËùÓзÇÊýÖµÔËËã(Èç×Ö·û,¼òµ¥ÊýÖµÐ͵ȵÈ)µÄSQL±äÁ¿¶¼¼ÓÒýºÅ;  
  2   ËùÓзÇÊýÖµÔËËãµÄSQL±äÁ¿µÄÖµ¶¼²ÉÓÃmagic_quotes_gpc» ......

ÔÚlinuxÉÏÅäÖÃunixODBCºÍFreeTDS·ÃÎÊMS SQL Server.

Ò», °²×° unixODBC
ÏÂÔØ°²×°°ü. ÔÚ RedHat °²×°¹âÅÌÉϾÍÓÐ
unixODBC-2.2.11-1.RHEL4.1.i386.rpm
unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm
unixODBC-kde-2.2.11-1.RHEL4.1.i386.rpm
°²×°
rpm -Uvh unixODBC-2.2.11-1.RHEL4.1.i386.rpm
rpm -Uvh unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm
Èç¹û°²×°ÖÐÌáʾÓжÔÆäËü° ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ