Quantcast
Channel: Select n random rows from SQL Server table - Stack Overflow
Viewing all articles
Browse latest Browse all 20

Answer by Shahriar Khazaei for Select n random rows from SQL Server table

$
0
0

In SQl Server 2017 and later you can use SAMPLETABLE phrase in your code like this :

SELECT * FROM TableName TABLESAMPLE (100 ROWS)orSELECT * FROM TableName TABLESAMPLE (10 PERCENT)


Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>