List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:February 12 2004 2:28pm
Subject:Re: Alias *all* columns in a joined table?
View as plain text  
> SELECT
>  person.*,place.* as home_*
> FROM
>  person,place
> WHERE
>  person.home_id = place.id
> AND
>  name = 'Joe'

What if more of your tables have a column "name"?

> To get back results like:
>  id,name,age,home_id,home_name,home_zip_code
>
> The problem is that I don't want to have to update my queries everytime I
> add a new column, so I use table_name.* a lot.  But then if I ever add a

Really? That's stupid :-) ... Ask only for the columns you need:
the rest is increased network traffic.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com

Thread
Alias *all* columns in a joined table?Isaac Reuben12 Feb
  • Re: Alias *all* columns in a joined table?Martijn Tonies12 Feb
    • Re: Alias *all* columns in a joined table?Isaac Reuben12 Feb