sqlserver ´¥·¢Æ÷ - MS-SQL Server / »ù´¡Àà
ÓÐÁ½¸ö±íÒ»¸öÊÇ¿Í»§¶©µ¥±í(¶©µ¥ºÅ£¬²úÆ·ºÅ£¬ÊýÁ¿£¬¼Û¸ñ£©,Ò»¸öÊÇÉÌÆ·±í(²úÆ·ºÅ£¬²úÆ·Ãû£¬²úÆ·ÊýÁ¿)
ÈçºÎÓô¥·¢Æ÷Íê³Éµ±²åÈë¿Í»§¶©µ¥±íºó£¬»á×Ô¶¯¸üÐÂÉÌÆ·±íÖеIJúÆ·ÊýÁ¿
Èô²úÆ·ÊýÁ¿²»¹»Ê±±¨´í£¨¿ÉÊä³öÎÄ×Ö±¨´íÐÅÏ¢£©
лл´ó¼Ò¡£
-- ×Ô¶¯¸üÐÂÉÌÆ·±íÖеIJúÆ·ÊýÁ¿
-- ²úÆ·ÊýÁ¿²»ÄÜΪ¸º£¬
-- ËùÒÔÔÚ×ö¶©µ¥Ê±£¬Òª¼ì²âÉÌÆ·±íÖеĵ±Ç°ÉÌÆ·¿â´æÁ¿£¬µ±¿â´æÁ¿²»×㣬´Ë¶©µ¥Ìá½»¾Í²»Äܳɹ¦£¡
-- (ÒòΪÄãû¿â´æ£¬ÔõôÄûõ¸øÈ˼ÒÄØ£¿)
-- Õâ¸öÎÊÌâÒª¿¼ÂǵĶ«Î÷ºÜ¶à£¬²»½ö½öÊÇÒ»¸ö´¥·¢Æ÷Äܽâ¾öµÄ£¡
Ïà¹ØÎÊ´ð£º
×Ö¶Î1,×Ö¶Î2.....×Ö¶ÎN,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
ÏëÒªµÄ½á¹ûÊÇ:
1,Na ......
ÐèÇóÈçÏ£º
ѧԺ 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='µÚÒ»°Ù¸öÐÕÃû'
......
¸÷λºÃ£¬ÎÒ¸Õ°ÑÒ»¸öASPÍøÕ¾ÉèÖúÃÁË£¬Ò²ÄÜÕý³£·ÃÎÊ¡£µ«ÊÇÔÚÎÒ±¾»úÉϲ»ÄÜ´ò¿ªadmin\login.asp,ËùÒÔÎÞ·¨ÊµÏÖºǫ́¹ÜÀí¡££¨´íÎóÌáʾÎÞ·¨ÕÒµ½ÍøÒ³£¬´úÂë404£¬ÎҵIJÙ×÷ϵͳÊÇwin2000 server)
µ«ÊÇÆæ¹ÖµÄÊÇÔÚ¾ÖÓòÍøµÄÆäËû» ......
select o_customer,o_price from orders having o_price >=avg(o_price)
select o_customer,o_price from orders where o_price >=(select avg(o_price) from orders)
ÎҸоõûÓÐÇø±ð°¡£¬ÔõôÔÚmysql»áÓÐ ......