Randomly Select a Row with SQL in Access

后端 未结 4 1017
梦毁少年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:14

    Ypercude provided a link that led me to the right answer below:

    SELECT TOP 1 ABBREVIATION
    FROM STATEABBREVIATION 
    ORDER BY RND(ID);
    

    Note that for RND(), I believe that it has to be an integer value/variable.

提交回复
热议问题