On Sat, 7 May 2005, Jochem van Dieten wrote:
>On 5/7/05, Dan Bolser wrote:
>> On Sat, 7 May 2005, Jochem van Dieten wrote:
>>>On 5/7/05, Dan Bolser wrote:
>>>
select pk from a inner join b using (pk);
ERROR 1052 (23000): Column 'pk' in field list is ambiguous!!!
Is this
On 5/7/05, Dan Bolser wrote:
> On Sat, 7 May 2005, Jochem van Dieten wrote:
>>On 5/7/05, Dan Bolser wrote:
>>
>>> 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 nu
On Sat, 7 May 2005, Jochem van Dieten wrote:
>On 5/7/05, Dan Bolser wrote:
>>
>> Why are columns included in the join between two tables ambigious?
>
>Because MySQL does not follow the SQL standard (ISO/IEC 9075-2:2003).
>
>
>> select pk from a inner join b using (pk);
>>
>> ERROR 1052 (23000):
On 5/7/05, Chris wrote:
> Somethign else to think about as well, look at this slight modification:
>
> select pk from a left join b using (pk);
>
>
> Now, it's not likely this is a valid query for your table structure
It is very likely it is. It is even an example in the MySQL manual.
> but,
On 5/7/05, Dan Bolser wrote:
>
> Why are columns included in the join between two tables ambigious?
Because MySQL does not follow the SQL standard (ISO/IEC 9075-2:2003).
> select pk from a inner join b using (pk);
>
> ERROR 1052 (23000): Column 'pk' in field list is ambiguous!!!
>
> Is this a
Hi!
Dan Bolser wrote:
[[...]]
I would have said...
select pk from a inner join b on a.pk = b.pk;
(probably pk was a bad choice for an example column name).
Using the ON syntax instead of the USING syntax makes my problem look even
more silly than it already is, i.e. just say
select a.pk from a inne
Somethign else to think about as well, look at this slight modification:
select pk from a left join b using (pk);
Now, it's not likely this is a valid query for your table structure,
but, in this instance, a.pk and b.pk are not necessarily the same. b.pk
could potentially be NULL while a.pk was n
gt;
To:
Sent: Friday, May 06, 2005 7:14 PM
Subject: Re: amPiguous!
> On 7/05/2005 11:00 a.m., 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:
On Fri, 6 May 2005, Eric Bergen wrote:
>He's right in saying that mysql is capable of knowing. My thoughts are
>that it's not worth the speed loss, extra code, and potential guess work
>by mysql just so you don't have to type a table name.
I see what you mean. I didn't think about additional qu
He's right in saying that mysql is capable of knowing. My thoughts are
that it's not worth the speed loss, extra code, and potential guess work
by mysql just so you don't have to type a table name.
Eric Jensen wrote:
The way he is joining tables is fine. You can specify how to link the
using ON
On Sat, 7 May 2005, Simon Garner wrote:
>On 7/05/2005 11:00 a.m., 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
On Fri, 6 May 2005, 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.
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
On 7/05/2005 11:00 a.m., 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'
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
15 matches
Mail list logo