Mysql select Query with multiple conditions of same column

假如想象 提交于 2019-12-11 07:11:40

问题


I need MySQL select query like

select wt_id,wt_name from work_type where cat_id=1,2,5..;

Is it possible?


回答1:


You just have to use IN operator

SELECT wt_id, wt_name 
FROM work_type 
WHERE cat_id IN (1,2,5..);



回答2:


Use IN operator ex.

... where cat_id IN (1,2,5..)



回答3:


You can use SQL IN operator.

SELECT wt_id, wt_name FROM work_type WHERE cat_id IN (1,2,5..);

If you have any question please comment below.



来源:https://stackoverflow.com/questions/27620069/mysql-select-query-with-multiple-conditions-of-same-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!