Hi folks,
suppose, there are 2 tables, each of them with a key called 'id'.
At first, i tried this:
select t1.id, t2.col from table1 as t1 , table2 as t2 where t1.id=t2.id
- and it worked fine.
To increase the performance (in fact, i will have more than 1 million rows!),
I read several docs and tried a equi-join with on-clause:
select t1.id, t2.col from table1 as t1 JOIN table2 as t2 ON t1.id=t2.id
- and this is what i get:
MySQL said: You have an error in your SQL syntax near 'ON t1.id=t2.id' at line 1
I ransacked my docs again but I don't get on it, what's wrong!
Any help would be greatly appreciated!
suppose, there are 2 tables, each of them with a key called 'id'.
At first, i tried this:
select t1.id, t2.col from table1 as t1 , table2 as t2 where t1.id=t2.id
- and it worked fine.
To increase the performance (in fact, i will have more than 1 million rows!),
I read several docs and tried a equi-join with on-clause:
select t1.id, t2.col from table1 as t1 JOIN table2 as t2 ON t1.id=t2.id
- and this is what i get:
MySQL said: You have an error in your SQL syntax near 'ON t1.id=t2.id' at line 1
I ransacked my docs again but I don't get on it, what's wrong!
Any help would be greatly appreciated!