want to sort the data so that the agencies with is_premium=1 comes first and the rest of the data is sorted by date_added desc order.
But also the is_premium=1 records should be sorted in random order. so first set of premium agencies will have random order. Is this possible to do in MySQL query?
Not sure about the random part, but you can sort on multiple columns
I'd have to say no, not in the query alone. I'd personally handle it on the side of Php.
Обсуждают сегодня