Randomly Select a Row with SQL in Access

后端 未结 4 1008
梦毁少年i
梦毁少年i 2020-12-22 00:27

I have a small access database with some tables. I am trying the code in the sql design within access. I just want to randomly select a record within a table.

I cre

4条回答
  •  醉梦人生
    2020-12-22 01:20

    Try this:

    SELECT TOP 1 *
    FROM tbl_name
    ORDER BY NEWID()
    

    Of course this may have performance considerations for large tables.

提交回复
热议问题