List:General Discussion« Previous MessageNext Message »
From:Richard Cyganiak Date:July 11 2005 3:50pm
Subject:Ambiguous column names in derived table
View as plain text  
Hi,

Suppose I have two tables Tbl1 and Tbl2. Both have a column called A.

MySQL 5.0.7 rejects this query as ambiguous:

SELECT A from Tbl1, Tbl2;

But it accepts this and returns the A column from Tbl1:

SELECT A FROM (SELECT * FROM Tbl1, Tbl2) AS foo;

But this query is rejected again:

SELECT * FROM (SELECT * FROM Tbl1, Tbl2) AS foo ORDER BY A;

Why is this? Is it a bug?

Thanks,
Richard

Thread
Ambiguous column names in derived tableRichard Cyganiak11 Jul
  • Re: Ambiguous column names in derived tableGleb Paharenko11 Jul