List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:May 17 2007 4:00pm
Subject:Re: Select question
View as plain text  
Erich,

 >Is there a way to set a prefix for each table so that
 >the results come out like tablename.column?

Use a scripting or application language to automate & parameterise query 
generation. SQL is just a partial computing language.

PB

-----

Erich C. Beyrent wrote:
> I have three tables, all of which have a 'name' column.
>
> If I do:
>
> select table1.*, table2.*, table3.* from ....
>
> I'll end up with a result set that has three 'name' fields, but no way 
> to distinguish which table the field belongs to.
>
> I know I can select individual columns like:
>
> select table1.name as foo, table2.name as bar ...
>
> but I need all the columns from each table and that will be very 
> tedious.  Is there a way to set a prefix for each table so that the 
> results come out like tablename.column?
>
> -Erich-
>
Thread
Select questionErich C. Beyrent17 May
  • Re: Select questionPeter Brawley17 May