I am trying to create a query that will shift the results on each execution for each user on my website. Goal to accomplish this using SQL Server 2008 database technology.
For example if I have a table with three rows of data:
I am trying to find a way to select this data order by name ascending then shifting/rotating the result.
ID Name
1 Apple
2 Orange
3 Banana
User 1 loads a page and sees
Apple
Banana
Orange
User 1 reloads the same page and then sees
Banana
Orange
Apple
User 1 reloads the same page and then sees
Orange
Apple
Banana
User 2, etc have the exact same experience, rotating/shifting of the results in the same order.
I can create and store any values necessary such as the first or last name or ID.
Is there a simple elegant solution (query, stored procedure, function, etc) that will accomplish this task at the SQL Server level?
The reason being is to give all colors the opportunity to be displayed at the top of the list vs alphabetical ordered A to Z.