Random call record [SQL Server]

xiaoxiao2021-03-06  59

?

The Northwind database comes with SQL Server 2000 as an example: SELECT TOP 3 * from EmployeesOrder by newid () multiple times, see the output of the output? If you want the data that is called every time you call it, this is a tag each time you call a tag, such as: add a flag field Flag (Tinyint) to the Employee table, so that it defaults to 1 and, Update Employees Set Flag = 1, before calling, all FLAG is equal to 1 After the call Update Employees set flag = 0 Where EmployeeiD = ... Called code changed to SELECT TOP 3 * from Employeeswhere Flag = 1Order by newid ( )

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

New Post(0)