mysql判断某一条数据是否存在
方式一:
SELECT IFNULL((SELECT 'Y' from classification_question where question_id = 2 limit 1),'N')
方式二:
SELECT case WHEN COUNT(*) > 0 THEN 'Y' else 'N' END from classification_question WHERE question_id = 200 LIMIT 1
SELECT IFNULL((SELECT 'Y' from classification_question where question_id = 2 limit 1),'N')
SELECT case WHEN COUNT(*) > 0 THEN 'Y' else 'N' END from classification_question WHERE question_id = 200 LIMIT 1