Here are two statements that I\'d like to work, but which return error messages:
IF EXISTS (SELECT * FROM gdata_calendars WHERE `group` = ? AND id = ?) SELE
SELECT IF(( SELECT count(*) FROM gdata_calendars WHERE `group` = ? AND id = ?) ,1,0);
For Detail explanation you can visit here