Sql if exists

This article is tagged with: Sql if exists and mysql

if exists sql server

IF EXISTS (SELECT * FROM tblGLUserAccess WHERE GLUserName ='xxxxxxxx')
BEGIN
SELECT 1
END
ELSE
BEGIN
SELECT 2
END

sql if exists

if exists(select 1 from table where id = 4)

This article is tagged with: Sql if exists and mysql