X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B8286D1D84E for ; Mon, 1 Mar 2004 03:59:36 +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 76566-03 for ; Sun, 29 Feb 2004 23:59:34 -0400 (AST) Received: from millenium.mst.co.jp (unknown [210.230.185.241]) by svr1.postgresql.org (Postfix) with ESMTP id 9B8C9D1CCA7 for ; Sun, 29 Feb 2004 23:59:33 -0400 (AST) Received: from mst1x5r347kymb (lc12114 [192.168.1.114]) by millenium.mst.co.jp (8.11.6p2/3.7W) with SMTP id i213xMv25792; Mon, 1 Mar 2004 12:59:22 +0900 Message-ID: <022701c3ff41$69646490$7201a8c0@mst1x5r347kymb> From: "Iain" To: "Abdul Wahab Dahalan" , References: <40429AA1.4060905@mimos.my> Subject: Re: How to get Rows Count Date: Mon, 1 Mar 2004 12:58:09 +0900 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: 200402/409 X-Sequence-Number: 17099 howabout: select sum(case when c = '*' then 0 else 1 end) as count_not_star from tablename If you want to process all records but only count thouse without a * in c then this will do the trick. regards iain ----- Original Message ----- From: "Abdul Wahab Dahalan" To: Sent: Monday, March 01, 2004 11:06 AM Subject: [SQL] How to get Rows Count > > > > > >a b d c > >01 02 b * > >01 02 a * > >02 03 > >02 04 b * > >02 04 a * > >03 05 > >04 06 > > > If I've a table like above, how do I make a query to get rows count that > doesnt have '*' in it. > > Can we have other queries than this : Select count(c) from tablename > where c !='*'; > or Select count(c) from tablename where c <> '*'; > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)