Search Postgresql Archives

Re: wildcard alias

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2006-11-10 at 23:34 +0100, Martijn van Oosterhout wrote:
> 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
> > 

Yes: SELECT foo as bar from baz;

Sincerely,

Joshua D. Drake



> > 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
> 
-- 

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux