Kani
Kani

Reputation: 47

Mysql select Query with multiple conditions of same column

I need MySQL select query like

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

Is it possible?

Upvotes: 1

Views: 1787

Answers (3)

Chetan
Chetan

Reputation: 51

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.

Upvotes: 0

starko
starko

Reputation: 1149

Use IN operator ex.

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

Upvotes: 3

Saharsh Shah
Saharsh Shah

Reputation: 29051

You just have to use IN operator

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

Upvotes: 2

Related Questions