List:General Discussion« Previous MessageNext Message »
From:Colin McKinnon Date:June 29 1999 2:34pm
Subject:Re: Question concering data retrieval from multiple tables...
View as plain text  
At 12:23 29/06/99 -0400, Technische Dienst wrote:
>Hi there, I'm sortta having a big problem.
>
<snip>
>select * from Towers, CPU where Art_Num=03025; (just picked a number)
>gives me:
>ERROR 1052: Column: 'Art_Num' in where clause is ambiguous 
<snip>

Bad SQL - 

1)If you're using two relations in a SELECT you really ought to join them
(unless you've a very good reason not to).

2)If you use the same name for an attribute in different relations you need
to explicitly reference the one you're specifying in the WHERE clause:
      select * from Towers where Towers.Art_Num=03025;
this is why you got the error message you did.

Check the archive for online SQL learning resources.

Colin


Thread
Question concering data retrieval from multiple tables...Technische Dienst29 Jun
  • Re: Question concering data retrieval from multiple tables...Clyde Smith-Stubbs29 Jun
  • Re: Question concering data retrieval from multiple tables...Colin McKinnon29 Jun
Re: Question concering data retrieval from multiple tables...Andrew Dunstan29 Jun