Select only half the records

Posted by coffeeaddict on Stack Overflow See other posts from Stack Overflow or by coffeeaddict
Published on 2009-03-26T16:53:40Z Indexed on 2010/05/18 17:20 UTC
Read the original article Hit count: 133

Filed under:

I am trying to figure out how to select half the records where an ID is null. I want half because I am going to use that result set to update another ID field. Then I am going to update the rest with another value for that ID field.

So essentially I want to update half the records someFieldID with one number and the rest with another number splitting the update basically between two values for someFieldID the field I want to update.

© Stack Overflow or respective owner

Related posts about tsql