How to return duplicates if IN (...) has duplicates? I have a list containing 1, 1, 2.

I am using it in a query like this: 

SELECT A.* FROM A WHERE id IN (1, 1, 2)


The output is this: 

id
---
1
2


I want the results to be like this:

id
---
1
1
2


How can I achieve that?
You can do this with a JOIN:

SELECT a.* 
FROM a 
  JOIN 
    ( VALUES (1), (1), (2)
    ) AS p (id)
  ON a.id = p.id ;