Check the Existence of Rows in a Table
Are there better ways to check the existence of rows in a table instead of using the code below?
DECLARE
row_count INT;
....
BEGIN
SELECT COUNT(*) INTO row_count FROM table WHERE condition;
IF row_count > 0 THEN --Record exists
-- Do sth
ELSE
-- Do sth else
END IF;
..
END;
Thanks,
Sambath
0