i have a table like given below.
id | city1 | city2 | distance
----------+---------+-------------+-----------
1 | Jane B | japan | 8
2 | Joe A | florida | 11
3 | Joe F | california | 215
4 | Jane A | ghana | 3
5 | Jane B | florida | 8
6 | Joe C | jakarta | 11
7 | Joe F | california | 215
8 | Joe A | japan | 3
Suppose if i want to find common city2 for jow A and jane B, how can i retrieve this in mysql.( the result will be japan and florida in this case).If i provide two values from city1 column,the result comes out to be a common values of both if exists from column city2.
SELECT DISTINCT city2 FROM your_table_name WHERE city1='Joe A' OR city1 = 'Jane B';