Re: sum(if command - Mailing list pgsql-general

From CoL
Subject Re: sum(if command
Date
Msg-id 3D85BD61.7080208@mportal.hu
Whole thread Raw
In response to sum(if command  ("king" <king_pepper99@hotmail.com>)
List pgsql-general
mysql "case": http://www.mysql.com/doc/en/Control_flow_functions.html
postgres "case":
http://www.postgresql.org/idocs/index.php?functions-conditional.html

C.

king wrote:
> 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
>
>
>
>
>


pgsql-general by date:

Previous
From: "king"
Date:
Subject: Re: sum(if command
Next
From: Martijn van Oosterhout
Date:
Subject: Re: psql: \pset pager 'always'?