I would like to ORDER my results like this :
$query_resultat .= "ORDER BY case
when vendue = 'AV' then 1
when vendue = 'VPNA' then 2
when vendue = 'EC' then 3
when vendue = 'V' then 4
when vendue = 'SCDV' then 5
else 6 end";
But I'm asking if it's possible to add another condition like this :
Order results first when vendue = 'AV'
AND also ORDER this result by Id DESC
In a second time, order results when vendue = 'VPNA'
AND also ORDER this result by ID DESC
Is it possible to do that ?
If you want the items to be order by ID within your other criteria, you can just add it on to the end of the ORDER BY clause...
$query_resultat .= "ORDER BY case
when vendue = 'AV' then 1
when vendue = 'VPNA' then 2
when vendue = 'EC' then 3
when vendue = 'V' then 4
when vendue = 'SCDV' then 5
else 6
end,
ID DESC";