January 13th, 2004, 08:20 PM
Calling all tsql Gurus
Hi all I have a guestion that is making my brain hurt.
I have a table with a list of names and an ID that identifies them with a group. It looks like
I need to update the table using a stored procedure. I need to take 58% of the records and change their GroupID = 2 and take 42% of the records and change their GroupID to 3. I am totally stumped and was wondering if any one has any Ideas or if this is even possible?
January 13th, 2004, 11:38 PM
You will have to round your round your percentage based on your data population. You will first need to calculate the total number of records then you can use top [n], where n is the calculated number.