i am very new to sql databases and i have the following question
I need to search in the component table for all components that have the ID's matching a list of ID's (see example).
Component table
ID Name
1 component 1
... ...
10 component 10
List of ID's = (1,8,3)
query for this:
SELECT * FROM Component
WHERE ID IN (1,8,3)
This will give me ID 1,3 and 8, that is correct, but in a different order. Is there a way to keep the order like the order of the list (1,8,3 instead of 1,3,8)?
the link that provided the query: SQL Statement using Where clause with multiple values
Thanks in advance, Theo