Keep the list order when using IN (<cfqueryparam list="xyz" ...)

I am passing a list of 25 SKU's to a cfquery and need to return the data pulled in the same order that the list is in. When I pass the list to the query in the where statement (see below) the order the items come out of the query are not in the same order:

If there's no "logic" to how the SKUs should be ordered other than the order in the list, the only other option is to generate a custom order by clause. Loop over the SKUs and create an order by that looks like:

Code:

ORDER BY
CASE WHEN products.pid = 'First SKU' THEN 1
WHEN products.pid = 'Second SKU' THEN 2
WHEN products.pid = 'Third SKU' THEN 3
...etc...
END