²éѯǰ¼¸Ìõ¼Ç¼SQLÔÚ²»Í¬Êý¾Ý¿âÖеÄÓ÷¨
²éѯǰ¼¸Ìõ¼Ç¼SQLÔÚ²»Í¬Êý¾Ý¿âÖеÄÓ÷¨
1. ORACLE
SELECT * from TABLE1 WHERE ROWNUM<=N
2. INFORMIX
SELECT FIRST N * from TABLE1
3. DB2
SELECT * ROW_NUMBER() OVER(ORDER BY COL1 DESC) AS ROWNUM WHERE ROWNUM<=N
»òÕß
SELECT COLUMN from TABLE FETCH FIRST N ROWS ONLY
4. SQL SERVER
SELECT TOP N * from TABLE1
5. SYBASE
SET ROWCOUNT N
GO
SELECT * from TABLE1
6. MYSQL
SELECT * from TABLE1 LIMIT N
7. FOXPRO
SELECT * TOP N from TABLE ORDER BY COLUMN
8.postgres
SELECT * from TABLE LIMIT N
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
Ò»¡¢Í¨¹ýÆóÒµ¹ÜÀíÆ÷½øÐе¥¸öÊý¾Ý¿â±¸·Ý¡£´ò¿ªSQL SERVER ÆóÒµ¹ÜÀíÆ÷£¬Õ¹¿ªSQL SERVER×éLOCALϵÄÊý¾Ý¿â£¬ÓÒ¼üµã»÷ÄãÒª±¸·ÝµÄÊý¾Ý¿â£¬ÔÚµ¯³öµÄ²Ëµ¥ÖÐÑ¡ÔñËùÓÐÈÎÎñϵı¸·ÝÊý¾Ý¿â£¬µ¯³ö±¸·ÝÊý¾Ý¿â¶Ô»°¿ò£º
µã»÷Ìí¼Ó°´Å¥£¬Ìîд±¸·ÝÎļþµÄ·¾¶ºÍÎļþÃû£¬µã»÷È·¶¨Ìí¼Ó±¸·ÝÎļþ£¬µã»÷±¸·Ý¶Ô»°¿òÉϵı¸·Ý£¬¿ªÊ¼½øÐб¸·Ý¡£
&nbs ......
ÔÚSQL SERVERÖУ¬Äã¿ÉÄÜÐèÒª»ñµÃµ±Ç°ÈÕÆںͼÆËãһЩÆäËûµÄÈÕÆÚ£¬ÀýÈ磬ÄãµÄ³ÌÐò¿ÉÄÜÐèÒªÅжÏÒ»¸öÔµĵÚÒ»Ìì»òÕß×îºóÒ»Ìì¡£ÄãÃǴ󲿷ÖÈË´ó¸Å¶¼ÖªµÀÔõÑù°ÑÈÕÆÚ½øÐзָÄê¡¢Ô¡¢Èյȣ©£¬È»ºó½ö½öÓ÷ָî³öÀ´µÄÄê¡¢Ô¡¢ÈյȷÅÔÚ¼¸¸öº¯ÊýÖмÆËã³ö×Ô¼ºËùÐèÒªµÄÈÕÆÚ£¡ÔÚÕâƪÎÄÕÂÀÎÒ½«¸æËßÄãÈçºÎʹÓÃDATEADDºÍDATEDIFFº¯ÊýÀ´¼ÆË ......
£Ó£Ñ£Ì Óï·¨²Î¿¼ÊÖ²á(SQL)/Êý¾ÝÀàÐÍ
2006-07-24 07:42
¡¶£Ó£Ñ£Ì Óï·¨²Î¿¼ÊÖ²á(SQL)¡·
DB2 ÌṩÁ˹ØÁ¬Ê½×ÊÁÏ¿âµÄ²éѯÓïÑÔ £Ó£Ñ£Ì (Structured Query Language)£¬ÊÇÒ»Öַdz£¿ÚÓﻯ¡¢¼ÈÒ×ѧÓÖÒ׶®µÄÓï·¨¡£´ËÒ»ÓïÑÔ¼¸ºõÊÇÿ¸ö×ÊÁÏ¿âϵͳ¶¼±ØÐëÌṩµÄ£¬ÓÃÒÔ±íʾ¹ØÁ¬Ê½µÄ*×÷£¬°üº¬ ......
.SQL SERVERµÄÊý¾ÝÀàÐÍ
Êý¾ÝÀàŪÊÇÊý¾ÝµÄÒ»ÖÖÊôÐÔ£¬±íʾÊý¾ÝËù±íʾÐÅÏ¢µÄÀàÐÍ¡£ÈκÎÒ»ÖÖ¼ÆËã»úÓïÑÔ¶¼¶¨ÒåÁË×Ô¼ºµÄÊý¾ÝÀàÐÍ¡£µ±È»£¬²»Í¬µÄ³ÌÐòÓïÑÔ¶¼¾ßÓв»Í¬µÄÌص㣬Ëù¶¨ÒåµÄÊý¾ÝÀàÐ͵ĸ÷ÀàºÍÃû³Æ¶¼»ò¶à»òÉÙÓÐЩ²»Í¬¡£SQLServer ÌṩÁË 25 ÖÖÊý¾ÝÀàÐÍ£º
·Binary [(n)]
·Varbinary [ ......