Reputation: 570
I have a table called replies
. There is a column inside it called approval
.
The values I used are yes
no
, and disapproved
yes
is approved by admin and shown to everyone.no
is not approved yet and shown to the admin only.disapproved
is disapproved by admin and shown to none.Is there a way to select the replies in approval column with two values ? yes
and no
.
because I don't want to show the disapproved
replies
I search the web and stackoverflow. i got no where maybe because I didn't use the right key words for my question.
Upvotes: 0
Views: 110
Reputation: 3323
Will this work:
SELECT * FROM replies WHERE approval != 'disapproved'
Upvotes: 0
Reputation: 20885
Simply use the IN
in the WHERE
clause:
SELECT * FROM replies WHERE approval in ('yes', 'no');
Live fiddle. Is this what you want?
Upvotes: 0
Reputation: 659367
SELECT * FROM replies WHERE approval IN ('yes', 'no');
Or if there are not other values possible than the three you mentioned:
SELECT * FROM replies WHERE approval <> 'disapproved';
Upvotes: 2