Search Postgresql Archives

Re: query from two tables & concat the result

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

 



On 03/02/2016 13:11, arnaud gaboury wrote:

> Hum hum...
> ------------------------------------------------------
> SELECT u.username ||'@'||d.domain as email_address
> FROM email.mailusers u
> INNER JOIN
> email.domain d
> ON
> (u.domain_id=d.domain.id)
> WHERE id=1;
> 
> ERROR:  missing FROM-clause entry for table "domain"
> LINE 6: (u.domain_id=d.domain.id)
> --------------------------------------------------------------
> 
> What did I wrong following your solution?

In the join condition, replace "d.domain.id" with "d.id" (partly my
mistake, I missed that the column is called "id" and not "domain_id" in
the domains table).

Ray.

-- 
Raymond O'Donnell :: Galway :: Ireland
rod@xxxxxx


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[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