SELECT u.id, u.email from users u.email IN ('u2.gmail.com', 'firstname.lastname@example.org', 'email@example.com');
| 5 | firstname.lastname@example.org | | 2 | email@example.com | | 1 | firstname.lastname@example.org |
The output order is done based on the email address ascending. But I want to keep the order from the
IN clause, ie -
| 2 | email@example.com | | 1 | firstname.lastname@example.org | | 5 | email@example.com |
I've already tried with
ORDER BY FIELD() but it's not working. Can anyone help me how can I get this?