Hello all --
Quick one for yas...
Say I have 100 records in a table that meet some criteria that I want to update by. How would I update only half of these to reflect a new value in one column???
For example:
I INSERT 100 new records in a table with a default value of 0 for a column called 'findMe'. After these INSERTS, I need to go back through those 100 records and assign 50% of the findMe columns to be equal to 1. My first shot at this was:
UPDATE TOP 50 tableName SET findMe = 1 WHERE dateReceived = '08/17/01'
But of course, that didn't work. RDBMS is SQL Server 7.0 if that helps any.
Thanks!
Paul Prewett
Quick one for yas...
Say I have 100 records in a table that meet some criteria that I want to update by. How would I update only half of these to reflect a new value in one column???
For example:
I INSERT 100 new records in a table with a default value of 0 for a column called 'findMe'. After these INSERTS, I need to go back through those 100 records and assign 50% of the findMe columns to be equal to 1. My first shot at this was:
UPDATE TOP 50 tableName SET findMe = 1 WHERE dateReceived = '08/17/01'
But of course, that didn't work. RDBMS is SQL Server 7.0 if that helps any.
Thanks!
Paul Prewett