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

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Õâ¸öֵû¸Ä±ä£¬ËùÒÔ²éѯ½á¹ûҲûÓиı䡣


Ïà¹ØÎĵµ£º

AccessÓëSql ServerÖ®ASP´úÂë±È½Ï

ºǫ́Êý¾Ý¿â£º
[Microsoft Access]
Óë
[Microsoft Sql Server]
¸ü»»Ö®ºó£¬ASP´úÂëӦעÒâÒªÐ޸ĵÄһЩµØ·½£º
[Ò»]Á¬½ÓÎÊÌ⣨¾ÙÀý)
[Microsoft Access]
constr = "DBQ=c:\data\clwz.mdb; DRIVER={Microsoft Access Driver (*.mdb)}"
[Microsoft Sql Server]
constr = "DRIVER={SQL Server};SERVER=host;DATA ......

ASP.NETʵÏÖÔöɾ¸Ä²éµÈ¹¦ÄÜ(Access°æ)ϵͳ֮ËÄ É¾³ý

//¸ù¾ÝÖ÷¼üÀ´É¾³ý±íÖеÄÊý¾Ý¡£
//ɾ³ý
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        OleDbConnection sqlConnection = new OleDbConnection(GetConnection());
 
   & ......

accessϵķÖÒ³·½°¸

¾ßÌå²»¶à˵ÁË£¬Ö»Ìù³öÏà¹ØÔ´Âë~
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;
using System.Web;
/**//// <summary>
/// Ãû³Æ£ºaccessϵķÖÒ³·½°¸£¨·Âsql´æ´¢¹ý³Ì£©
/// ×÷Õߣºcncxz(³æ³æ)
/// blog£ºhttp://cncxz.cnblogs.com
/// ......

MSSQLÊý¾Ý¿âÖз¢ÏÖD99_tmp±íµÄ´¦Àí·½·¨

ÏàÐźܶàASP+MSSQLµÄÍøÕ¾¶¼Óб»ÈË×¢Èë¹ýµÄ¾­Àú£¬Êý¾Ý¿â±íÖжàÁËһЩ±í£¬ÀàËÆÒÔϵıíD99_tmp,D99_cmd£¬kill_kk¡£
D99_tmp£¨subdirectory,depth,fileÈý¸ö×ֶΣ¬ÀïÃæµÄÊý¾Ý¶¼ÊÇÍøÕ¾ÎļþºÍĿ¼£©
MSSQLÊý¾Ý¿â´æÔÚ¼¸¸öΣÏÕµÄÀ©Õ¹´æ´¢¹ý³Ì£¬Ä¬ÈÏPublic×é¿ÉÖ´ÐÐȨÏÞ£¬SQL×¢ÈëÕß¿ÉÀûÓô˶ÁÈ¡ÎļþĿ¼¼°Óû§×飬²¢¿Éͨ¹ýÏÈдÈëÊý¾ ......

Access¡¢SQLServer¡¢Oracle³£¼ûSQLÓï¾äÓ¦ÓÃÇø±ð


Access¡¢SQLServer¡¢Oracle³£¼ûSQLÓï¾äÓ¦ÓÃÇø±ð
¹Ø¾¢ËÉ PMP
Èç¹ûÒª¼æÈÝAccess¡¢SQL Server¡¢OracleÈý¸öÊý¾Ý¿â°æ±¾£»ÎÒÃÇÔÚ±àдSQLÓï¾äµÄ¹ý³ÌÖУ¬¾¡Á¿Ê¹ÓÃһЩͨÓõÄÓï¾ä£¬µ«»¹ÊÇÓÐЩ·½ÃæÓÐЩÇø±ð±ÜÃâ²»ÁË£¬ÏÖ¼òµ¥×ܽáһϡ£
ÒÔÏÂA´ú±íAccess,S´ú±íSQL Server,O´ú±íOracle
1¡¢È¡µ±Ç°ÏµÍ³Ê±¼ä
A:Select Now()
S:Selec ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ