I want to replace my
SELECT * FROM TABLE 1, TABLE 2
WHERE tbl1.aaa = tbl2.bbb
to replace something with join clause, and similar other replacements vice verse, is there a quick reference on this?
I want to replace my
SELECT * FROM TABLE 1, TABLE 2
WHERE tbl1.aaa = tbl2.bbb
to replace something with join clause, and similar other replacements vice verse, is there a quick reference on this?
Its as simple as below.
SELECT * FROM tbl1 INNER JOIN tbl2 ON tbl1.aaa = tbl2.bbb
References to learn about JOIN
https://dev.mysql.com/doc/refman/5.0/en/join.html
http://www.tutorialspoint.com/mysql/mysql-using-joins.htm
Try this script:
SELECT *
FROM TABLE 1 as tbl1
JOIN TABLE 2 as tbl2
on tbl1.aaa = tbl2.bbb
or