V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
jurant
V2EX  ›  PHP

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

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

    随机取 10 条不同的数据

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