List:General Discussion« Previous MessageNext Message »
From:Eric Jensen Date:May 7 2005 1:15am
Subject:Re: amPiguous!
View as plain text  
The way he is joining tables is fine.  You can specify how to link the
using ON or you can just say to use a commonly named field with USING. 
The Problem is with the SELECT pk.  That is ambiguous.  From what table
would you like the pk field?  It can be table1.pk or table2.pk.

Eric Jensen

Rhino wrote:

>Actually, the error message is misleading. There is nothing that I would
>call ambiguous in your query: you have a syntax error. The join should be
>written:
>
>    select pk from a inner join b on a.col1 = b.col2
>
>Of course, you need to replace 'a.col1' and 'b.col2' with real column names
>from tables a and b respectively.
>
>Rhino
>
>----- Original Message ----- 
>From: "Dan Bolser" <dmb@stripped>
>To: <mysql@stripped>
>Sent: Friday, May 06, 2005 6:50 PM
>Subject: amPiguous!
>
>
>  
>
>>Why are columns included in the join between two tables ambigious?
>>
>>It seems that they should *not* be ambigious!
>>
>>Like this
>>
>>select pk from a inner join b using (pk);
>>
>>ERROR 1052 (23000): Column 'pk' in field list is ambiguous!!!
>>
>>Is this a bug, or is it like this for a reason? It drives me nuts, because
>>it is not ambigious (as far as I can tell). Am I a fool?
>>
>>
>>
>>-- 
>>MySQL General Mailing List
>>For list archives: http://lists.mysql.com/mysql
>>To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>>
>>
>>-- 
>>No virus found in this incoming message.
>>Checked by AVG Anti-Virus.
>>Version: 7.0.308 / Virus Database: 266.11.5 - Release Date: 04/05/2005
>>
>>
>>    
>>
>
>
>
>  
>

Thread
amPiguous!Dan Bolser7 May
  • Re: amPiguous!Rhino7 May
    • Re: amPiguous!Simon Garner7 May
      • Re: amPiguous!Dan Bolser7 May
    • Re: amPiguous!Eric Jensen7 May
      • Re: amPiguous!Eric Bergen7 May
        • Re: amPiguous!Dan Bolser7 May
          • Re: amPiguous!Chris7 May
            • Re: amPiguous!Jochem van Dieten7 May
    • Re: amPiguous!Dan Bolser7 May
      • Re: amPiguous!Joerg Bruehe7 May
  • Re: amPiguous!Rhino7 May
  • Re: amPiguous!Jochem van Dieten7 May
    • Re: amPiguous!Dan Bolser7 May
      • Re: amPiguous!Jochem van Dieten7 May
        • Re: amPiguous!Dan Bolser15 May