I have the following users table:
id, username, email
1, abcdef, [email protected]
2, mnopqr, [email protected]
I would like to get all records in the table where username in ('abcdef', 'ghijkl', 'mnopqr', 'stuvwx') and return null rows if the username is not found. So in the following table I am expecting the following result (in the same order that the username appear in my IN clause:
id, username, email
1, abcdef, [email protected]
null, null, null -- null values for username ghijkl
2, mnopqr, [email protected]
null, null, null -- null values for username stuvwx
How can I achieve that?