Re: Fetching a single column from a record returning function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kumar" <sgnerd(at)yahoo(dot)com(dot)sg>
Cc: "psql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Fetching a single column from a record returning function
Date: 2004-01-20 15:58:04
Message-ID: 24270.1074614284@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Kumar" <sgnerd(at)yahoo(dot)com(dot)sg> writes:
> select * from fn_email(1)
> as (email_folder_id int4,email_folder_name varchar,descrip varchar,msgcount
> int8,unreadcount int8,size int8);

> Is it possible to fetch only one column (the 'msgcount') from the function.=
> Because I am interested in SUM(msgcount). Please shed some light.

select sum(msgcount) from fn_email(1)
as (email_folder_id int4,email_folder_name varchar,descrip varchar,msgcount
int8,unreadcount int8,size int8);

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Browne 2004-01-20 16:06:51 Re: comparing nulls
Previous Message Jeff Eckermann 2004-01-20 15:53:41 Re: comparing nulls