I'm running a simple select query in mysql that orders results by the most recent:
select * from table order by time desc
What I'm trying to do is modify this slightly. I want to display some specific results at the top based on specific criteria. I'm hoping I can do this within one query, but I'm not sure.
So the criteria for the results at the top would be:
where status=2 and time > $time_constraint
Obviously, I can run 2 queries:
q1 = select * from table where status=2 and time > $time_constraint order by time desc
q2 =select * from table order by time desc
But is there a way to combine this into one?