Einzelnen Beitrag anzeigen

omata

Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
 
Delphi 7 Enterprise
 
#7

Re: Anzahl der Ergebnis-Zeilen einer Query per SQL ermitteln

  Alt 2. Sep 2006, 13:09
Hallo FrankBKK,

oder alles in einer Abfrage...

SQL-Code:
SELECT auto_id_customer, SUM(unit_qty * unit_price) summe,
       (SELECT COUNT(*)
        FROM (SELECT auto_id_customer
              FROM v_transactions
              WHERE inv_date > '01/01/2006'
              GROUP BY auto_id_customer
              HAVING SUM(unit_qty * unit_price) < 100000) x) zeilen
FROM v_transactions
WHERE inv_date > '01/01/2006'
GROUP BY auto_id_customer
HAVING SUM(unit_qty * unit_price) < 100000
Gruss
Thorsten
  Mit Zitat antworten Zitat