I am a bit lost. Here is my query:
SELECT id, title FROM products WHERE id IN (4,2,6,4,2);
The query will result in 3 records only.
How can I get all 5 records (in this case I do want to see the duplicates).
Many thanks.
Update: Sorry for not being exact enough. Thanks for the comments, indeed I didn't understand the "IN" correctly.
This is my data:
---------------------
| id | title |
---------------------
| 2 | product_2 |
---------------------
| 4 | product_4 |
---------------------
| 6 | product_6 |
---------------------
My intention is to receive the following data since I have a list of ids:
---------------------
| id | title |
---------------------
| 4 | product_4 |
---------------------
| 2 | product_2 |
---------------------
| 6 | product_6 |
---------------------
| 4 | product_4 |
---------------------
| 2 | product_2 |
---------------------
So I have a list of ids and want to receive the title of the product. Ideally even the order should be preserved.