SUM() später in WHERE-Klausel ?
Hallo,
ich möchte in einer Abfrage mit SUM() eine Spalte erzeugen und diese dann in der WHERE Klausel mit verwenden.
Also z.B:
SELECT SUM(anzahl) AS summe FROM items WHERE OrderDate > '2012-04-08 00:00:00' AND summe > 20 GROUP BY items.name
Das funktioniert so aber nicht. Gibt es eine Möglichkeit dafür?
HAVING passt nicht so richtig, da die Gruppierung erst nach dem Filter passieren sollte, was mit HAVING ja nicht möglich ist.
Danke schonmal
Mark
Subject
Views
Written By
Posted
SUM() später in WHERE-Klausel ?
2236
April 11, 2012 06:18AM
1197
April 11, 2012 07:24AM
1203
April 13, 2012 04:53AM
1170
April 13, 2012 05:36AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.