Subject Re: [firebird-support] Select returns too many columns
Author Helen Borrie
At 12:03 AM 19/03/2007, you wrote:
>Yet another book keeping routine
>this fails
>select /*mas.DIRECTION,*/
> mas.CUSTID,
> Cust.CUST_NAME as Cust_Sup,
>
> count(mas.ID),
> case
> when mas.DIRECTION = 'CREDIT' then sum( mas.ENTRY_TOTAL)
> else 0
> end as Credit,
>
> case
> when mas.DIRECTION = 'DEBIT' then Sum( mas.ENTRY_TOTAL)
> else 0
> end as Debit
>
>from TRANS89 mas
>left join MACT_CUST_SUP_LIST Cust on Cust.CUSTID = mas.CUSTID
>
>where Cust.CUSTID in ('7', '8', '9')
>
>group by 1, 2/*, 3*/
>
>order by 1
>
>But if I remove the comments it runs ok but I get money direction
>which I am trying to avoid.
>FB 1.5 win xp server and client
>
>Am I stuck with getting Direction?

Yes, because it is needed for calculating the output set. But why
does it matter? You don't have to show it to the UI, do you?

./heLen