List:General Discussion« Previous MessageNext Message »
From:Dotan Cohen Date:October 19 2011 3:00pm
Subject:Re: What is wrong with this outer join?
View as plain text  
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
Thread
What is wrong with this outer join?Dotan Cohen19 Oct
  • Re: What is wrong with this outer join?MySQL)19 Oct
    • Re: What is wrong with this outer join?Dotan Cohen19 Oct
      • Re: What is wrong with this outer join?MySQL)19 Oct
        • Re: What is wrong with this outer join?Dotan Cohen20 Oct
          • Re: What is wrong with this outer join?MySQL)20 Oct
            • Re: What is wrong with this outer join?Peter Brawley20 Oct
            • Re: What is wrong with this outer join?Dotan Cohen20 Oct
Re: What is wrong with this outer join?Dotan Cohen19 Oct
  • Re: What is wrong with this outer join?hsv20 Oct