Ensure order when select two rows using two identifiers on the same column I'm trying to write a query to retrieve exactly two rows from a table using the same column for identification.

SELECT * FROM teams WHERE name = $1 OR name = $2;


Is there any way to ensure that the result for name = $1 is the first result returned and name = $2 is the second?
SELECT * 
FROM teams 
WHERE name IN ($1, $2)
ORDER BY CASE WHEN name = $1 THEN 0 ELSE 1 END;