mysql order by values and then show the rest -
i want order results of mysql query
1) show first entrys wich match given condition , order them randomly
2) , show rest of results ordered date desc
i tryed this:
select * post inner join user on post.user_id = user.id order user.type = "top" desc, created desc; many thanks
use case statement
select * post inner join user on post.user_id = user.id order case when user.type = 'top' 1 else 2 end asc, created desc;
Comments
Post a Comment