Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: Joining wit...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 3456 of 3799
Post > Topic >>

Re: Joining with result of a plpgsql function

by matthew@[EMAIL PROTECTED] ("Matthew T. O'Connor") May 8, 2008 at 01:21 AM

Stephan Szabo wrote:
> On Wed, 7 May 2008, Matthew T. O'Connor wrote:
>   
>> But I would really like to be able to combine it with other data and
get
>> a result set that looked like:
>>
>> f.id, f.name, tms_summary.col1, tms_summary.col2 ...
>>     
>
> Well I think
>  select f.id, f.name, (tms.get_tms_summary(f.id)).* from foo f;
> would expand it out into separate columns, but I think that might also
> call it multiple times.  You might have better luck combining that with
a
> subquery like
>  select id, name, (summary).col1, (summary).col2, ... from
>   (select id, name, tms.get_tms_summary(f.id) as summary from foo) f;

Ah, I knew there was an easy way to do it, I totally forgot / missed / 
didn't know about the (composite type).* syntax.

Thank you!


-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 3 Posts in Topic:
Joining with result of a plpgsql function
matthew@[EMAIL PROTECTED]  2008-05-07 23:28:10 
Re: Joining with result of a plpgsql function
sszabo@[EMAIL PROTECTED]   2008-05-07 21:07:19 
Re: Joining with result of a plpgsql function
matthew@[EMAIL PROTECTED]  2008-05-08 01:21:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 21:33:29 CST 2008.