MySQL, if a value is in one of two columns, return the value from the other one
- by erikric
Hi,
This might be an easy one, but I'm not really experienced with sql.
I have a table with two user_id columns, user1 and user2. This table contains some compared values between the two users.
I want to send in an user id, and return all the id's from the other user when the sent user is either user1 or user2.
I guess some sort of if test would do the trick, but I don't know how to do this in SQL.
Cheers