sum(if command

From: "king" <king_pepper99(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: sum(if command
Date: 2002-09-13 16:46:55
Message-ID: 3Eog9.617491$m91.25037299@bin5.nnrp.aus1.giganews.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Does posgres support the equivalent to the mysql sum(if command in a SQL
statement? I did not see reference to it in my readings.

For example:
SELECT STYLENO, SUM(IF(RECORDTYPE='5', TOTALQTY,0)) AS 'ONHAND'
FROM WHOE314 WHERE SEASON='202' AND STYLENO NOT LIKE'S%'
GROUP BY SEASON, STYLENO

thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-09-13 16:51:42 Re: problem in select
Previous Message frank_lupo 2002-09-13 16:32:36 problem in select