I have the following table PLAYLIST
where I have the columns VIDEO
and STATUS
:
VIDEO | STATUS
The status
column varies between 1
and 0
being 1
for new videos and 0
for videos that have already been watched.
I'm currently running two select
:
SELECT * FROM playlist WHERE status='1';
if result > 0 {
echo ok
} else {
SELECT * FROM playlist WHERE status='0'
}
Can you make this query using only 1 SELECT
? preferably without using php?
My goal is to prioritize videos that have not been viewed.