Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
(select top 1 percent A from B order by newid())
テーブル B からランダムなレコードを取得したい
このように使用...
select * from B where A in (select top 1 percent A from B order by newid())
また
select top 1 percent A from B order by newid()
どちらも毎回ランダムな行を提供します....
編集 :
大きなテーブルから行をランダムに選択する