Reputation: 820
I have a table name tbl_Employees
id Name Designation
1 Rajeev Developer
2 Deepak Developer
3 Pankaj Sales
4 Siksha Sales
5 Parul Sales
6 Nikita HR
7 Dinesh Account
8 Mahiman Travel
9 Mukesh Adevertising
10 Pulkit Marketing
11 Diksha Database
12 Gurinder Database
I am using the select query as
select * from tbl_Employees
Now I am trying to show 5 rows on my .aspx
page. now my query is that the 5 rows data is randomly change on every PageLoad
event.
Upvotes: 0
Views: 197
Reputation: 1744
You can use NEWID()
to select records rendomly as below:
SELECT TOP(5) * FROM tbl_Employees ORDER BY NEWID()
Upvotes: 3