mysql query to check record exists in database table or not

Solutions on MaxInterview for mysql query to check record exists in database table or not by the best coders in the world

showing results for - "mysql query to check record exists in database table or not"
Fay
17 Jun 2018
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;