[前][次][番号順一覧][スレッド一覧]

mysql:504

From: Tamon Nomura <Tamon Nomura <tamon@xxxxxxxxxx>>
Date: Thu, 07 Jan 1999 09:59:55 +0900
Subject: [mysql 504] Re: SUM と IFの組み合わせ


tamonです。

> select
>  code,
>  sum(Cheque),
>  sum(if(Chqgst=1, ,0.00)) as Recgst,
>  sum(Deposit)
>  sum(if(Depgst=1, Deposit / 9,0.00)) as Paygst,
> from
>  statement
> group by
>  1
> ;  

テーブルの構造とか分かりませんが
group by Depgst;
では?


[前][次][番号順一覧][スレッド一覧]

       502 1999-01-07 09:46 [<minako-mm@xxxxxxxxx] SUM  と IF の組み合わせ                 
->     504 1999-01-07 09:59 ┗[Tamon Nomura <tamon@]                                       
       511 1999-01-07 16:32  ┗[Tamon Nomura <tamon@]