Re: wildcard alias

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Matthew Terenzio <matt(at)jobsforge(dot)com>
Cc: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: wildcard alias
Date: 2006-11-10 22:34:22
Message-ID: 20061110223422.GC18137@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I don't know what your query or aliases have to do with joins, but if
you want to join two tables on all fields with the same name, you can
do a NATURAL JOIN.

Have a nice day,

On Fri, Nov 10, 2006 at 05:17:12PM -0500, Matthew Terenzio wrote:
>
> I suppose I should have named things differently but is there a way to
> join two tables with a bunch of identical column names and rather than
> explicitly alias each column just use some sort of wildcard like:
>
> SELECT tablename.* AS alias.*
>
> OR do I have to name each column like:
>
> columnname as alias
>
> Thanks much.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message George Pavlov 2006-11-10 23:21:21 apparent wraparound
Previous Message Matthew Terenzio 2006-11-10 22:17:12 wildcard alias