For clarification, are you able to use MySQL this way to sort?
ORDER BY CompanyID = XXX DESC
What I am trying to do is use one sql query to sort everything where X = Y, in this case, where CompanyID = XXX. All values where CompanyID is not XXX should come after all the results where CompanyID = XXX.
I don’t want to limit my query but I do want to sort a particular company above other listings.
Your query is fine.
CompanyID = xxxyields 1 on a match, and 0 otherwise. Just add the CompanyID column as the secondary order column.This way, you get records where the CompanyID matches your constant first, then the rest are in order.
Alternatively, you could do this: