Monday, March 1, 2010

Does a row exist?

Mostly just tired of looking this one up in other places, because my brain can't seem to hang onto the syntax:

SELECT IF EXISTS (
SELECT column
FROM table
WHERE some stuff is true )
THEN 1
ELSE 0
ENDIF
FROM SYS.DUMMY

1 comment:

Darren said...

That is odd syntax. Are you using SQL Anywhere?