Accessing random rows from database without repetition

前端 未结 2 1903
夕颜
夕颜 2021-01-28 09:04

I have designed a quiz scenario using MySQL database as my backend.

I have a total of 20 questions and I would want to display them in random order from the

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-28 09:52

    If the table contains duplicate records, use SELECT DISTINCT to filter them out.

    SELECT DISTINCT *
    FROM mst_que
    ORDER BY RAND()
    

提交回复
热议问题