There are many ways to select a random record or row from a
database table. We have SQL syntax for this task, we can easily fetch random
row from sql database table.
Table: builder
id
|
buildername
|
1
|
DLF
|
2
|
Amerpali
|
3
|
vision
|
4
|
rampark
|
SELECT TOP 2 *
FROM builder TABLESAMPLE
(100 ROWS) order by NEWID()
OUTPUT:
OUTPUT:
id
|
buildername
|
2
|
Amerpali
|
4
|
rampark
|
No comments :
Post a Comment