I'm having trouble finding the syntax for a statement (or whether or not it's even possible).
We're running SQL Server 2005, and I'd like to do something like:
IF ((SELECT count(*) FROM mytable WHERE userid = 'myid' AND value = 3) < 1) then INSERT INTO mytable VALUES ('myid', 3)
Any suggestions? Thanks