Some time ago, the customer raised a requirement that the query results should be sorted randomly. I couldn't understand a lot of things I found, and finally solved the problem. The solution is as follows: add something after ORDERBY. Note: It may only apply to Access. This is only tested in the Access environment. SELECT * FROMtableNameORDERB
Some time ago, the customer raised a requirement that the query results should be sorted randomly. I couldn't understand a lot of things I found, and finally solved the problem. The solution is as follows: add something after order. Note: It may only apply to Access. This is only tested in the Access environment. SELECT * FROM tableName ORDER B
Some time ago, the customer raised a requirement that the query results should be sorted randomly. I couldn't understand a lot of things I found, and finally solved the problem. The solution is as follows:
Just add something after order.
Note: It may only apply to Access. This is only tested in the Access environment.
"SELECT * FROM tableName order by right (cstr (rnd (-int (rnd (-timer () * 100 + numID) * 1000 * Now (), 2 )"
The key is the order by clause. The numID in the middle must be an existing field in the database, and Now () is used to make random results more variable.
The NewId () function can be used in the same way as in SQL Server.