Reputation: 498
I have a list of integers resulting from a SELECT
query.
The list of integers is not sequential! For example it might contain values like
1,2,3,8,12,17,20,23,28,30,...
I want to select one integer randomly from that list! How do I do this?
Upvotes: 0
Views: 124
Reputation: 263933
based on your statement: "select one integer randomly from that list", you can use NEWID()
on this case.
SELECT TOP 1 colName
FROM tableName
ORDER BY NEWID()
Other Link(s)
Upvotes: 2