-3

Table Structure

Id  your_user_id     my_user_id
1   33              35
2   35              45
3   36              35
4   35              47
5   46              50

Expecting

Join Record
33
45
36
47

I want to get all matches record of id 35 wheather it is in my_user_id or in your_user_id

Amy
  • 163
  • 1
  • 11
  • Why nowadays nobody is trying to think a bit but instead looking for ready solutions. Sorry, Amy but that's not the way how you'll learn anything. – Dawid Rutkowski Nov 09 '17 at 12:08

1 Answers1

0

Using union you get this result

SELECT B FROM `test2` WHERE C=35
union
SELECT C FROM `test2` WHERE B=35
Bhargav Chudasama
  • 6,928
  • 5
  • 21
  • 39