On 12 February 2010 10:28, Richard Huxton wrote:
> On 11/02/10 22:53, Greenhorn wrote:
>>
>> But I seem to be getting (after the join) the sum of amount x count of
>> notes. Can someone enlighten me with this problem?
>
>> select
>> energy_accounts_id, count(note)
>> ,sum(case when t.fin_year
On 11/02/10 22:53, Greenhorn wrote:
But I seem to be getting (after the join) the sum of amount x count of
notes. Can someone enlighten me with this problem?
select
energy_accounts_id, count(note)
,sum(case when t.fin_year = 2010 and t.fin_quarter = 1
then t.total_amount else 0 e