sql selecting one random row code example
Example 1: select random rows sql
Using a SAMPLE clause, we can select random rows.
SELECT * FROM table_name SAMPLE(10);
Example 2: t-sql random number for each row
ABS(CHECKSUM(NewId())) % 14
Using a SAMPLE clause, we can select random rows.
SELECT * FROM table_name SAMPLE(10);
ABS(CHECKSUM(NewId())) % 14