1

I need MySQL select query like

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

Is it possible?

2
  • Can you provide sample data and desired results? Commented Dec 23, 2014 at 12:26
  • I got the desired result using 'IN' operator. Commented Dec 23, 2014 at 12:34

3 Answers 3

3

Use IN operator ex.

... where cat_id IN (1,2,5..)
Sign up to request clarification or add additional context in comments.

Comments

2

You just have to use IN operator

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

1 Comment

This result works as ORed query.. What about ANDed queries? Can u refer to this link
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.