Reputation: 1
I want to join these two queries to get the result in one query. How do I do that?
SELECT Serial_no,BOOTH_NO FROM table WHERE BOOTH_NO IN ('1','2');
SELECT serial_no,BOOTH_NO FROM table WHERE BOOTH_NO IN ('3','4') AND [serial_no]%2=0
Upvotes: 0
Views: 78
Reputation: 117345
select
t.serial_no, t.booth_no
from table as t
where
t.booth_no in ('1','2') or
t.booth_no in ('3','4') and t.[serial_no] % 2 = 0
Upvotes: 1
Reputation: 166356
Why do you need to seperate the queries?
Try using something like
SELECT Serial_no,
BOOTH_NO
FROM table
WHERE BOOTH_NO IN ('1','2')
OR (BOOTH_NO IN ('3','4') AND [serial_no]%2=0)
Upvotes: 3