I am trying to update some fields based on their occurence. If they only occur one time, I am updating some status field.
My current code is as follows:
Try this
Use Top
UPDATE table1 SET statusField = 1 WHERE someID = ( SELECT TOP 1 someID FROM table1 GROUP BY someID HAVING COUNT(*) = 1 )
Or you can use IN clause
UPDATE table1 SET statusField = 1 WHERE someID IN ( SELECT someID FROM table1 GROUP BY someID HAVING COUNT(*) = 1 )