I have the following users table:
id, username, email
1, abcdef, abcdef@gmail.com
2, mnopqr, mnopqr@gmail.com
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, abcdef@gmail.com
null, null, null -- null values for username ghijkl
2, mnopqr, mnopqr@gmail.com
null, null, null -- null values for username stuvwx
How can I achieve that?