資料庫
SELECT TOP (10) * FROM TableName ORDER BY NEWID()
預設看資料都是取前n筆, order by 也只是看最後幾筆,因此想使用隨機取的方式,避免看到的資料太狹隘
Select n random rows from SQL Server table https://stackoverflow.com/questions/848872/select-n-random-rows-from-sql-server-table
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up