I am still a noob when it comes to SQL statements. I have had some help here from a few of you and hopefully you can explain the difference between these SQL statements.
SQL Statement 1.
SELECT * FROM Table1, Table2
Where Table1.ID = Table2.ID;
SQL Statement 2.
SELECT * FROM Table1
WHERE ID IN(SELECT Table2.ID FROM Table2);
For some reason SQL statement 2 does not work on the MySQL system I am using. When I try SQL Statement 1 using MySQL Front it seems to lock up. I think this is due to needing more RAM. (Table1 has 700,000 records, Table2 has 400,000 records.) I am going to try and upgrade the RAM but I want to make sure I have written SQL statement 1 to give me the same info as statement 2. Any other rewrites are also welcome.
Thanks,
Zych
SQL Statement 1.
SELECT * FROM Table1, Table2
Where Table1.ID = Table2.ID;
SQL Statement 2.
SELECT * FROM Table1
WHERE ID IN(SELECT Table2.ID FROM Table2);
For some reason SQL statement 2 does not work on the MySQL system I am using. When I try SQL Statement 1 using MySQL Front it seems to lock up. I think this is due to needing more RAM. (Table1 has 700,000 records, Table2 has 400,000 records.) I am going to try and upgrade the RAM but I want to make sure I have written SQL statement 1 to give me the same info as statement 2. Any other rewrites are also welcome.
Thanks,
Zych