dimanche 22 juillet 2018

[Help-SQL]: i don't want the same number in cell when i am updating table column next time using Random function

I have the following query to update random number in [SetID] column.

" UPDATE Employee SET SetID = CAST(RAND(CHECKSUM(NEWID())) * 5 as INT) + 1 " Update Random Number query

But sometimes i am getting same number on a few rows after executing query. i don't want to repeat the previous number again on that row. Thanks in advance. :)




Aucun commentaire:

Enregistrer un commentaire