ACCESSºÍMSSQL ÈçºÎËæ»ú¶ÁÈ¡Êý¾Ý¿â¼Ç¼
²éѯÓï¾äÖ»ÒªÕâÑùд,¾Í¿ÉÒÔËæ»úÈ¡³ö¼Ç¼ÁË
SQL="Select top 6 * from Dv_bbs1 where isbest = 1 and layer = 1 order by newID() desc"
ÔÚACCESSÀï
SELECT top 15 id from tablename order by rnd(id)
SQL Server£º
Select TOP N * from TABLE Order By NewID()
Access£º
Select TOP N * from TABLE Order By Rnd(ID)
Rnd(ID) ÆäÖеÄIDÊÇ×Ô¶¯±àºÅ×ֶΣ¬¿ÉÒÔÀûÓÃÆäËûÈκÎÊýÖµÀ´Íê³É£¬±ÈÈçÓÃÐÕÃû×Ö¶Î(UserName)
Select TOP N * from TABLE Order BY Rnd(Len(UserName))
MySql£º
Select * from TABLE Order By Rand() Limit 10
SQLÊý¾Ý¿âÓиönewidº¯Êý£¬¿ÉÒԺܷ½±ãµÄÓÃSQLÓï¾äµÃµ½±íÖеÄËæ»úÊý¾Ý¡£µ«accessÊý¾Ý¿âûÕâô·½±ã£¬ËäÈ»ÓиöRnd£¬¿ÉÒÔͨ¹ý“select top 10 * from tb order by rnd(id)”µÃµ½Ëæ»úÊý¾Ý£¬¿ÉϧÔÚVBÖÐʹÓ㬲úÉúµÄËæ»úÐòÁÐÊÇÒ»ÑùµÄ¡£
ÓÐÈË˵ÔÚ³ÌÐòÖмÓÉÏRandomize³õʼ»¯Ëæ»úÖÖ×Ó£¬ÄÇôÕâֻ˵¶ÔÁËÒ»°ë£¬ÔÚ³ÌÐòÖмòµ¥µÄ¼ÓÉÏRandomize£¬ÊÇû×÷Óõģ¬µÀÀíºÜ¼òµ¥£¬Randomize²»¿ÉÄÜÓ°ÏìSQLÓï¾äÖеÄrnd,ÄÇÖ»²»¹ýÊǸö×Ö·û´®£¬SQLÓï¾äÊǷŵ½jetÖÐÈ¥Ö´Ðеġ£
ǰЩÌìÔÚÂÛ̳ÉÏ¿´µ½ÓÐÈË˵ÓÃtime£¬ÄÇôֻÓÃrnd(time)ÕâÑùÊDz»Ðеģ¬rndÖбØÐëÒª°üº¬±íÖеÄÒ»¸ö×Ö¶Î(ÈÎÒâ×ֶΣ¬µ±È»ÊÇÖ÷¼üЧ¹û¸üºÃ)£¬²âÊÔÏÂÀ´£¬rnd(time+id)ÕâÑùÒÀÈ»²»ÐÐ! ²»¹ý·Ç³£ÒâÍâµÄÊÇrnd(time-id)È´³É¹¦ÁË¡£ÎªÊ²Ã´ËµÒâÍ⣬°´ÎÒµÄÀí½â£¬timeÔÚÓëÊýÖµ×öÔËËãʱ£¬»áת»»³ÉÒ»¸öСÓÚ1µÄdouble£¬ÕâÑùÓëID£¨´óÓÚ1µÄÕýÖµ£©×ö¼õÔËËãµÄ½á¹û±ØÈ»ÊÇÒ»¸ö¸ºÊý£¬ÎÒÃÇÖªµÀrndÈç¹ûÓÃÁ˸ºÊýÖÖ×Ó£¬»á²úÉúÏàͬµÄËæ»úÐòÁУ¬ÕâÊÇÎļþ¼Ó½âÃÜËã·¨Öг£Óõ½µÄ·½·¨£¬¿ÉÔÚÕâ¶ùÈ´Äܵõ½ÕýÈ·µÄ½á¹û£¬µ½ÏÖÔÚҲûÏëͨ......
½ÓÏÂÈ¥£¬ÓÃrnd(time-id)¼ÌÐø²âÊÔÄã»á·¢ÏÖ£¬Á¬Ðø¿ìËٵزéѯÏ£¬»áÓÐÎÊÌ⣬»á³öÏÖ¶þ´Î»òÈý´Î²éѯ½á¹ûÒ»ÑùµÄÎÊÌâ¡£·ÖÎöһϿÉÒÔÕÒµ½ÔÒò£¬rnd(number)ÖеÄnumberÊǸösingle£¬ÕâÑùËü»á½Ø¶Ïtime-idÕâ¸öÔËËã½á¹ûdoubleºóÃæÊý×Ö£¬ÕâÑù¿ìËÙ²éѯʱnumberÕâ¸öֵû¸Ä±ä£¬ËùÒÔ²éѯ½á¹ûҲûÓиı䡣
Ïà¹ØÎĵµ£º
ת×Ô£ºhttp://dev.yesky.com/243/2230743.shtml
ADO(ActiveX Data Object)ÊÇMicrosoftÊý¾Ý¿âÓ¦ÓóÌÐò¿ª·¢µÄнӿڣ¬Êǽ¨Á¢ÔÚOLE DBÖ®Éϵĸ߲ãÊý¾Ý¿â·ÃÎʼ¼Êõ£¬¼´Ê¹Äã¶ÔOLE DB£¬COM²»Á˽âÒ²ÄÜÇáËɶԸ¶ADO,ÒòΪËü·Ç³£¼òµ¥Ò×Óã¬ÉõÖÁ±ÈÄãÒÔÍùËù½Ó´¥µÄODBC API¡¢DAO¡¢RDO¶¼ÒªÈÝÒ×ʹÓ㬲¢²»Ê§Áé»îÐÔ¡£±¾ÎÄÏêϸµØ½éÉÜÔÚVisual C ......
ACCESSÖÐÖظ´ÐеĴ¦Àí
ACCESSÖУ¬Ê¹ÓÃdistinctºÍgroup byºó£¬Èç¹ûÔÚjavaÖÐʹÓÃrs.next()µÄ»°£¬¾Í»áÌáʾ“ÎÞЧµÄÓαꔴíÎó¡£
µ«ÊÇ£¬²¢·Ç²»Ö§³ÖÉÏÃæÁ½¸öÓï·¨¡£
ËùÒÔ£¬¿ÉÒÔͨ¹ýÒÔÏÂÓï·¨½øÐжþ´Î²éѯ£¬½«Öظ´Êý¾ÝÈ¥µô¡£
select stockName from (select stockName from stock group by stockName) order by stock ......
ÉÏÍøgoogleÁËһϣ¬¿´Á˼¸¸öÈ˵ÄÌû×Ó£¬´ó¸ÅÃ÷°×ÁËÊÇʲôÒâ˼¡£
Èç¹ûÒ»¸öÓû§µÄIPÔÚ×î½üÒ»¶Îʱ¼äÄÚ¶à´ÎÓÉÓÚÃÜÂë´íÎóµÇ¼ʧ°Ü£¬ÄÇôϵͳ¾Í»á°ÑÕâ¸öÓû§·âµô£¬submit»òÕßmail¾Í»áÌáʾAccess denied.
Õâ±¾ÊÇÒ»¸ö°²È«´ëÊ©£¬µ«ÊÇûÏëµ½poj¿ªÍ¨ËùνµÄ"¹«Íø¼ÓËÙ"Ö®º ......
ת×Ô
http://topic.csdn.net/t/20050110/09/3711952.html
accessÖÐʱ¼äÒªÓÃ#,²»ÊÇË«ÒýºÅ
select * from kc where rq < #2000-01-01# and rq>#2002-01-01#
²»ÒªÓÃbetween,ËüµÄЧÂÊÌ©µÍ
ʹÓÃ# ¶ø²»ÊÇ ......