• <dl id="2u8ki"><small id="2u8ki"></small></dl>
    • <rt id="2u8ki"><em id="2u8ki"></em></rt>
    • <menu id="2u8ki"></menu>
      0712-2888027 189-8648-0214
      微信公眾號

      孝感風(fēng)信網(wǎng)絡(luò)科技有限公司微信公眾號

      當(dāng)前位置:主頁 > 技術(shù)支持 > MySQL > MySQL語句如何實(shí)現(xiàn)從數(shù)據(jù)庫表中查詢隨機(jī)數(shù)據(jù)的記錄

      MySQL語句如何實(shí)現(xiàn)從數(shù)據(jù)庫表中查詢隨機(jī)數(shù)據(jù)的記錄

      時間:2016-07-20來源:風(fēng)信官網(wǎng) 點(diǎn)擊: 786次
      MySQL語句如何實(shí)現(xiàn)從數(shù)據(jù)庫表中查詢隨機(jī)數(shù)據(jù)的記錄

      1. Oracle,隨機(jī)查詢20條
      select * from
      (
       select  *  from 表名
       order by dbms_random.value
      )
       where rownum <= 20;
       
      2.MS SQL Server,隨機(jī)查詢20條
      select top 20  * from  表名order by newid()
       
      3.My SQL:,隨機(jī)查詢20條
      select  *  from  表名 order by rand() limit 20

      SELECT * FROM phpcms_video where catid=17 order by rand()

      獲取到的隨機(jī)結(jié)果如下圖所示:

      MySQL語句如何實(shí)現(xiàn)從數(shù)據(jù)庫表中查詢隨機(jī)數(shù)據(jù)的記錄

      欄目列表
      推薦內(nèi)容
      熱點(diǎn)內(nèi)容
      展開
      中文字幕无码AV黄片,亚洲天堂日本美女,国产亚洲色婷婷久久99精品91,午夜无码不卡视频 99久色图精品国产 精品熟女少妇A∨免费久久
    • <dl id="2u8ki"><small id="2u8ki"></small></dl>
      • <rt id="2u8ki"><em id="2u8ki"></em></rt>
      • <menu id="2u8ki"></menu>