Randomly takes out several recorded SQL statements

xiaoxiao2021-03-06  37

Randomly takes out several recorded SQL statements SQL Server:

SELECT TOP 20 * From table Order by newid ()

Access:

SELECT TOP 20 * FROM Table ORDER BY RND (ID)

The ID (ID) of the RND (ID) is the automatic number field, which can be done with any other value.

For example, use Name Field (Username)

SELECT TOP 20 * FROM Table ORDER BY RND (LEN (UserName))

MySQL:

SELECT * FROM Table Order by Rand () LIMIT 20

转载请注明原文地址:https://www.9cbs.com/read-64747.html

New Post(0)