I have this stored procedure here:
UPDATE deals_CreditCards SET
[IsDefault] = -1
WHERE [UserID] = @UserID and [CardID]= ????
So the table contains multile records per UserID. The CardID is the primarykey. I want to make the very first record for that userID the default by seting its 'IsDefault' fields to true. The very first record for that userID would mean the lowst 'CardID' value.
Of all the many records matching a certain 'UserID', how do I set the 'IsDefault' field to true on the one record with the smalest 'CardID' value?
View Complete Post