Is there a way I can make mysql return results from a Member database by the order I ask it by in the WHERE command?
SELECT *
FROM Members
WHERE MemberID = "6"
OR MemberId="3"
OR MemberID="5"
Currently it will return results ordered by MemberID ASC no matter what I do. I want it to return by 6,3,5 i.e. in the order that I ask it.
SELECT
*
FROM
Members
WHERE
MemberID IN ("6","3","5")
ORDER BY
FIELD(MemberID,"6","3","5");
Select * from Members
WHERE MemberID = "6" or MemberId="3" or MemberID="5"
ORDER BY MemberID = "6" DESC, MemberId="3" DESC, MemberID="5" DESC;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With