I have a table in MySQL with below Structure
user_mst
----------------
user_id
user_name
left_id (fk to user_mst->user_id)
right_id (fk to user_mst->user_id)
Now I want to select the records the way that suppose,
user_id = 1
left_id = 2
right_id = 3
Now if I query records using User ID = 1, it should print user names that has ID 2 and 3.
Sorry for the question updating, I would like to print the 2 separate records for left_id and right_id.
So How can I do that ?
1 Answer