2
I have a table with two fields: dh_premium_expires
and score
.
dh_premium_expires - the date/time the user premium will expire.
score - score of the user within the game.
On my site I have a list where I list these users, and currently I am ordering in the following way:
ORDER BY dh_premium_expires DESC, score DESC;
I want the Premiums users to come first and then the highest score users. This way is working, however has a problem, premium users with more premium time are getting on top and I wanted it to be in that order:
Users with higher score awards.
Premium users.
Users with higher score.
For this I would have to create a setando variable 1 for those who are premium (dh_premium_expires > today’s date) and 0 for those who are not or have already expired. That would be right I guess.
How do I do this in Mysql?
It worked very well, thank you.
– user4919