I am having problem in joint two subqueries in MySQL, e.g.
(select * from table1 where id = 1 group by f1) a1
join
(select * from table2 where id = 2 group by f2) a2 ON a1.f3 = a2.f3;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join (select * from table1 where id = 2)' at line 1
Is my syntax incorrect?
Check out some examples
SELECT * FROM table1, table2;
SELECT * FROM table1 INNER JOIN table2 ON table1.id=table2.id;
SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id;
SELECT * FROM table1 LEFT JOIN table2 USING (id);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With