I have a typical situation.
my table has four column. (id, user, col2, status)
I want to write a query which gives me the results of col2. But it has a column status which has (0/1). So I want only col2 data which has 0 status + a user's all data (0/1).
id user col2 status
1 sam aa 1
2 sam bb 0
3 sam cc 1
4 max dd 0
5 max dd 1
6 max ee 1
7 jam ff 0
8 jam gg 1
My result should be like. I want sam's all result + other's only 0 status result.
id user col2 status
1 sam aa 1
2 sam bb 0
3 sam cc 1
4 max dd 0
7 jam ff 0