check if record exists mysql

Solutions on MaxInterview for check if record exists mysql by the best coders in the world

showing results for - "check if record exists mysql"
Ezra
30 Feb 2016
1-- Returns 1 if exists, 0 else
2SELECT EXISTS(SELECT 1 FROM my_table WHERE text LIKE '%something%');
3
4SELECT 
5	CASE 
6		WHEN EXISTS(SELECT 1 FROM my_table WHERE text LIKE '%something%') = 1 THEN
7    		'It exists'
8    	ELSE 'Does not exist'
9	END;