On Wed, Oct 19, 2011 at 16:33, Michael Dykman <mdykman@stripped> wrote:
> Try this. I sometime get wierd results when I fail to use aliases in a
> join. Also, the parentheses are required.
> - md
> select * from beers b inner join colours c on (b.colour = c.ID);
>
Thank you Michael. That does work, however when I convert it to an
outer join I get the same error as before:
mysql> select * from beers b inner join colours c on (b.colour = c.ID);
+----+-----------+--------+----+--------+
| ID | name | colour | id | colour |
+----+-----------+--------+----+--------+
| 1 | carlsburg | 2 | 2 | green |
| 2 | tuburg | 1 | 1 | red |
+----+-----------+--------+----+--------+
2 rows in set (0.30 sec)
mysql> select * from beers b outer join colours c on (b.colour = c.ID);
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 'outer join colours c on (b.colour = c.ID)' at line
1
mysql>
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com