mysql> select * from beers;
+----+-----------+--------+
| ID | name | colour |
+----+-----------+--------+
| 1 | carlsburg | 2 |
| 2 | tuburg | 1 |
| 3 | tuburg | 9 |
+----+-----------+--------+
3 rows in set (0.00 sec)
mysql> select * from colours;
+----+--------+
| id | colour |
+----+--------+
| 1 | red |
| 2 | green |
| 3 | blue |
+----+--------+
3 rows in set (0.00 sec)
mysql> select * from beers inner join colours on beers.colour = colours.ID;
+----+-----------+--------+----+--------+
| ID | name | colour | id | colour |
+----+-----------+--------+----+--------+
| 1 | carlsburg | 2 | 2 | green |
| 2 | tuburg | 1 | 1 | red |
+----+-----------+--------+----+--------+
2 rows in set (0.00 sec)
mysql> select * from beers outer join colours on beers.colour = colours.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 on beers.colour = colours.ID'
at line 1
So I've gone looking the fine manual, here:
http://dev.mysql.com/doc/refman/5.6/en/join.html
The manual references natural outer joins and requires curly brackets
and I'm frankly not making sense of it. Left, right, and inner joins
work as I expect them too, and fishing for examples in google doesn't
find anything unusual. How exactly am I erring?
Thanks!
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com