I have following table with data :
id send_user_id to_user_id status
1 5 56 0
2 5 125 1
3 500 5 1
4 850 5 0
5 5 365 0
6 5 800 1
7 8520 156 1
Now i want to get get where send_user_id =5 or to_user_id = 5 and status = 1
I have tried below query
select * from mtable
where send_user_id = 5 and status = 1 or to_user_id = 5 and status = 1
with above i am getting following data :
id send_user_id to_user_id status
2 5 125 1
3 500 5 1
6 5 800 1
but i want following output :
all_user_id
125
500
800