jurant
V2EX  ›  PHP

laravel 随机取 10 条不同的怎么取

  •  
  •   jurant · Jan 12, 2017 · 4049 views
    This topic created in 3598 days ago, the information mentioned may be changed or developed.

    随机取 10 条不同的数据

    2 replies  •  2017-02-14 15:40:47 +08:00
    phpman
    phpman
    Jan 18, 2017
    1
    随机 10 个 id 不就行了
    luishou
    luishou
    Feb 14, 2017
    2
    SELECT * FROM `table` ORDER BY RAND() LIMIT 10;
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2825 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 00:43 · PVG 08:43 · LAX 16:43 · JFK 19:43
    ♥ Do have faith in what you're doing.