你能帮我完成这个查询吗?
SELECT id_category FROM wrs_category_lang
WHERE id_lang = 5
AND name = keyword1, keyword2 with spaces, keyword3;
我希望从中获取id_category
与名称列表相对应的所有 ID。该列name
的类型为varchar(128)
。谢谢 !
您是否要求 IN 声明?:
SELECT id_category
FROM wrs_category_lang
WHERE id_lang = 5 AND name IN('keyword1','keyword2'...);
像这样的东西:
SELECT id_category
FROM wrs_category_lang
WHERE id_lang = 5
AND name IN ('keyword1', 'keyword2 with spaces', 'keyword3');