Skip site navigation (1) Skip section navigation (2)

subquery in FROM must have an alias

From: "Ashutosh Chauhan" <ashutosh(dot)chauhan(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: subquery in FROM must have an alias
Date: 2008-09-28 04:52:56
Message-ID: (view raw or whole thread)
Lists: pgsql-general
Hi all,

This has been asked before and answered as well. but I
still cant figure out why postgres throws this error message even when
I have provided the aliases. My query:

select a,b
	from (billing.item JOIN (
			select *
			from ( billing.invoice JOIN billing.customer
				                   on (id_customer_shipped = customer_uid and
address = 'pgh' ))
                        as temp2 ))
       as temp;

I have two from clauses so I have provided two corresponding alias
names for those two from clauses. But, still I get the error message

ERROR:  subquery in FROM must have an alias
HINT:  For example, FROM (SELECT ...) [AS] foo.

Any help on this will be greatly appreciated. I am using version 8.3.3
running on ubuntu.



pgsql-general by date

Next:From: hubert depesz lubaczewskiDate: 2008-09-28 11:35:31
Subject: Re: subquery in FROM must have an alias
Previous:From: Ricardo PinhoDate: 2008-09-28 00:57:31
Subject: GISVM - FOSS4G 2008 Special Edition

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group