Subject Re: [firebird-support] Case When Then
Author André Knappstein, Controlling
Spasiva!

It results in the same exception, though.


The example I gave is of course a simplified draft... would it matter
that the original statement is joining 2 tables?


Select
T.ID,
CASE
WHEN (T.Units > 0) THEN sum(X.Diff/T.Units)
ELSE sum(X.Diff)
END
from
AggOrdersUnits T
join
AggOrders X
on T.ID = X.ID
where
X.Diff > 0.05
group by
T.ID,
T.Units


I found another way of exposing and eliminating these records so I am
not in a hurry with this, but just curious...



--


~~~Ihre Nachricht~~~

DS> 16.02.2010 14:45, André Knappstein, Controlling wrote:
>> But the following does throw a server exception "Invalid expression in
>> the select list (not contained in either an aggregate function or the
>> GROUP BY clause). How would I put that syntax right?

DS> Group by T.Units in addition.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
beta Eigenheim- und Grundstücksverwertungsgesellschaft mbH
Hafenweg 4
59192 Bergkamen-Rünthe

Telefon: +49 2389 9240 0
Telefax: +49 2389 9240 150
e-mail: info@...

Amtsgericht Hamm Nr. B 420 || USt-IDNr.: DE 125215402
Geschäftsführer: Achim Krähling, Dirk Salewski, Matthias Steinhaus