Search Postgresql Archives

Re: join between a table and function.

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

 



In article <CAKWoFMJWZ3znXCj9rADn4ov+krsa-133968YvAg3L8M3W3zyQQ@xxxxxxxxxxxxxx>,
Lauri Kajan <lauri.kajan@xxxxxxxxx> writes:

> I have also tried:
> select
> *, getAttributes(a.id)
> from
>   myTable a

> That works almost. I'll get all the fields from myTable, but only a
> one field from my function type of attributes.
> myTable.id | myTable.name | getAttributes
> integer      | character        | attributes
> 123           | "record name" | (10,20)

> What is the right way of doing this?

If you want the attributes parts in extra columns, use

SELECT *, (getAttributes(a.id)).* FROM myTable a


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