Re: Fetching a single column from a record returning function - Mailing list pgsql-sql

From Tom Lane
Subject Re: Fetching a single column from a record returning function
Date
Msg-id 24270.1074614284@sss.pgh.pa.us
Whole thread Raw
In response to Fetching a single column from a record returning function  ("Kumar" <sgnerd@yahoo.com.sg>)
List pgsql-sql
"Kumar" <sgnerd@yahoo.com.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,msgcountint8,unreadcount int8,size int8);
        regards, tom lane


pgsql-sql by date:

Previous
From: Jeff Eckermann
Date:
Subject: Re: comparing nulls
Next
From: Joe Conway
Date:
Subject: Re: Fetching a single column from a record returning function