I'm having a table called file_download. I need to display
select * from file_download where downloaded = 1;
select * from file_download where downloaded = 0;
below is the sample table.
+----+----------+---------+------------+ | pk | filename | file | downloaded | +----+----------+---------+------------+ | 1 | aaa.txt | aaa.txt | 1 | | 2 | bbb.txt | aaa.txt | 1 | | 3 | ccc.txt | aaa.txt | 0 | | 4 | ccc.txt | aaa.txt | 1 | | 5 | ccc.txt | aaa.txt | 0 | | 6 | ccc.txt | aaa.txt | 0 | +----+----------+---------+------------+
Thanks in advance...
There are three ways to do the same
Using OR (cheaper in cost)
select * from file_download where downloaded = 1 or downloaded = 0
Using IN (short and accurate way)
select * from file_download where downloaded in (0, 1);
Using is not null (way not recommended)
select * from file_download where downloaded is not null