I have a requirement where I need to get rows using a list of string if it matches any value in the specified column.
SELECT * FROM assets WHERE name IN (:names)
But I also need to order some of its items that are guaranteed to exist from the above query. These are the names that should be in order, after that the rest can be in any order.
'BG123', 'AR234', 'QR45', 'DO456'
How can I order it based on these given value. I cannot use the PK since it is a random string. It should also work when the table is empty at first. Thanks
Additional sample:
I need to order these names as long as they exist, while the rest can be in any order and matching the names
list at the same time.
- Bon app
- Consolidated Holdings
- Around the horn