X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D6B99D1B4D1 for ; Wed, 21 Jan 2004 07:06:24 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 57829-01 for ; Wed, 21 Jan 2004 03:05:54 -0400 (AST) Received: from smtp106.mail.sc5.yahoo.com (smtp106.mail.sc5.yahoo.com [66.163.169.226]) by svr1.postgresql.org (Postfix) with SMTP id 207DFD1B45A for ; Wed, 21 Jan 2004 03:05:52 -0400 (AST) Received: from unknown (HELO IVESIA67) (sgnerd@203.196.190.138 with login) by smtp106.mail.sc5.yahoo.com with SMTP; 21 Jan 2004 07:05:51 -0000 Message-ID: <002e01c3dfec$200d6310$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "Tom Lane" Cc: "psql" References: <005101c3df24$2662ed20$7502a8c0@hdsc.com> <24270.1074614284@sss.pgh.pa.us> Subject: Re: Fetching a single column from a record returning function Date: Wed, 21 Jan 2004 11:59:02 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/189 X-Sequence-Number: 16582 Yes it worked. Thanks ----- Original Message ----- From: "Tom Lane" To: "Kumar" Cc: "psql" Sent: Tuesday, January 20, 2004 9:28 PM Subject: Re: [SQL] Fetching a single column from a record returning function > "Kumar" 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings