I have a table with the following columns:
playlistid
trackname
playstatus
likes
dislikes
created
playstatus can have the following values:0, 1, 2 and 4.
The sql query that Im using now is:
SELECT * from playlist
WHERE playlistid=$myplaylistid && playstatus=0
ORDER BY (likes-dislikes) DESC, created ASC
Its worth to mention that there at all times only will be one row with playstatus = 1, one row with playlistid=3, but there will be multiple rows with playstatus = 0 and 2.
I want to change the query above so that I get 1 row from where playstatus=3, 1 row from where playstatus=1, and 3 rows from where playstatus=0 in one single query. All these have to be chosen based on the same orderby that you see in the query above.
All help is appreciated! Thank you for your time!