Okay and do you know what those product ids are? how do you determine which those rows are?
The good news is once you can explain that it is pretty easy to do.
Lets say it is by productid and you want these rows listed first and in exactly this order:
and then the rest of the products below that in regular product id order.
To explain that the order by says check for productid in this specific list, if those numbers exist they are to be ordered at the top (assigned the 0), otherwise assign them in any order (assigned the 1),
CASE WHEN productid IN (45,37,18,101) then 0 else 1 end,
next the field(productid,45,37,18,101) says, hey if the product ids are this, then I want them in exactly this order
and finally the productid says to order all other values by their productid
so if you have a list of
then they will be sorted by the above as follows:
NOTE that the order by FIELD is mysql specific. if you want to stick to the sql standard then do this:
that will do the exact same as described above except without the proprietary code.
productid = 45 then 0
when productid =37 then 1
when productid=18 then 2
when productid=101 then 3
else 4 end,