Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update a view

Status
Not open for further replies.

aspnet98

MIS
May 19, 2005
165
US
I have a view that displays a random selection of ids for each user in my db.

id name selection
9 jay 4
5 jay 4
3 jan 4
1 jan 4
4 joe 4
8 joe 4

for each user, i need to update the top 5 ids in the selection column to a random 1 or 0 value. (rand() for each id seed)

is this possible?
 
opps when i said update the top 5 ids i meant the top 5 records because the query above uses order by new id() because i need to update random ids for everyone not just the first 5 in order....

 
i only show 2 for each user but picture 5 for each.

each five would have ids 1 - 5 in rand order new id ()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top