SQL¶à±í²éѯÎÊÌâ - MS-SQL Server / »ù´¡Àà
¹²ÓÐ5¸ö±í¡¾JC¡¿¡¢¡¾±í1¡¿¡¢¡¾±í2¡¿¡¢¡¾±í3¡¿¡¢¡¾±í4¡¿£»
==================================================
¡¾JC¡¿×ֶμ°Êý¾ÝÈçÏ£º
----------------------
»õºÅ µ¥¼Û2
001 £¤100
002 £¤200
003 £¤300
----------------------
¡¾±í1¡¿×ֶμ°Êý¾ÝÈçÏ£º
----------------------
»õºÅ ÊýÁ¿ µ¥¼Û1
001 50 £¤199
002 20 £¤299
001 10 £¤199
003 30 £¤399
004 40 £¤99
----------------------
¡¾±í2¡¿×ֶμ°Êý¾ÝÈçÏ£º
----------------------
»õºÅ ÊýÁ¿
001 10
002 5
003 15
----------------------
¡¾±í3¡¿×ֶμ°Êý¾ÝÈçÏ£º
----------------------
»õºÅ ÊýÁ¿
001 5
002 2
003 7
----------------------
¡¾±í4¡¿×ֶμ°Êý¾ÝÈçÏ£º
----------------------
»õºÅ ÊýÁ¿
001 3
002 5
003 11
----------------------
¡¾½á¹û¡¿£º
--------------------------------------------
»õºÅ ±í1ÊýÁ¿ µ¥¼Û1 ´æ»õ µ¥¼Û2
001 60 £¤199 48 £¤100
002 20 £¤299 18 £¤200
003 30 £¤399 19 £¤300
004 40 £¤99 40 £¤99
---------------------------------------------
¡¾ËµÃ÷¡¿£º
½á¹ûÖеÄ<»õºÅ>Ϊ¡¾±í1¡¿ÖгöÏÖµÄËùÓлõºÅ£»<±í1ÊýÁ¿>Ϊ¡¾±í1¡¿ÖлõºÅ·Ö×éºÏ¼ÆºóµÄÊýÁ¿£»<µ¥¼Û1>Ϊ¡¾±í1¡¿
Ïà¹ØÎÊ´ð£º
ÐèÇóÈçÏ£º
ѧԺ academy£¨aid,aname£©
°à¼¶ class£¨cid,cname,aid£©
ѧÉú stu(sid,sname,aid,cid)
סËÞÇø region(rid,rname)
ËÞÉáÂ¥ build(bid,rid,bnote) bnoteÊÇ¡®ÄС¯/¡®Å®¡¯
ËÞÉá dorm(did,rid,bid£¬bedn ......
ͨ¹ýNAME×Ö¶ÎÌõ¼þ²éѯһ¸öÊý¾Ý±í£¬¼ÙÉèÎÒÓÐ100¸öÐÕÃû£¬ÓÐÒÔÏÂÁ½¸ö·½·¨£¬
·½·¨1£º
°Ñ100¸öName ×é³ÉÒ»¸öSQLÓï¾ä£¬±ÈÈç Select * from tmp_table where Name='ÕÅÈý' or Name ='ÀîËÄ' Or ...Or Name='µÚÒ»°Ù¸öÐÕÃû'
......
SQL code:
rs.open "select * from guide where city_name='±±¾©' order by pai desc",conn,1,1
do while not rs.eof or rs.bof
¡£¡£
¡£¡£
¡£¡£
rs.movenext
loop
Õâ¸ösqlÓï¾äÔÚwapÕ¾Àï ±¾ÉíÓÐ ......
ÔÚAccessµÄ²éѯÖÐÖ´ÐÐÏÂÃæµÄÓï¾ä,ÎÞЧ,ÌáʾÆÚ´ýselect ,updata ,...
CreateTble C=Answer N="»ØÌû±í"
(
C=ID T="INTEGER" P=No M=No N="񅧏" Z=false,
C=Ques ......
ÎÒÓÐÒ»¸ö×Ö¶ÎÊÇ varchar(1) ÀàÐÍ£¬¶þ½øÖƱíʾҲ¾ÍÊÇ8λµÄ ¡®0000 0000¡¯
±ÈÈçÕâ¸öʱºòÎÒÐèҪɸѡ³öÕâ¸ö×Ö¶ÎΪËùÓÐµÄ ¡®0000 0100¡¯µÄÐУ¬ÇëÎÊSQLÄÜʵÏÖÕâÑùµÄ¡°Î»¡±µÄɸѡÂð£¿
лл~~~
ÓÐλ²Ù×ݺ¯ÊýÂ𣿲»ÐоÍ× ......