Join 2 subqueries in MySQL
0
May I ask if anyone knows how to join 2 subqueries in MySQL? The following syntax below ran into a syntax error when I executed it on MySQL. SELECT * FROM ( SELECT Staff_ID1 FROM phase_2.same_staff ss, staff s where ss.staff_ID1 = s.staff_ID and ss.staff_ID2 > s.staff_ID and staff_name = 'Vincent ho'; ) as q1 INNER JOIN ( Select * from staff where Staff_ID in ( SELECT Staff_ID2 FROM phase_2.same_staff ss, staff s where ss.staff_ID1 = s.staff_ID and ss.staff_ID2 > s.staff_ID and staff_name = 'Vincent ho'); ) as q2 ON q1.Staff_ID1 = q2.Staff_ID1 ;
mysql subquery
share
asked 9 mins ago
...