Einzelnen Beitrag anzeigen

omata

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

Re: brauche dringend HILFE bei SQL-Abfrage

  Alt 22. Apr 2006, 13:21
Hallo polondo,

welche Datenbank?

was spricht gegen ein OR?
SQL-Code:
SELECT DISTINCT invoicepos.quantity AS output,
                productbookingpos.quantity AS income,
                ABS( COALESCE(invoicepos.quantity, 0)
                    - COALESCE(productbookingpos.quantity, 0)) AS diff
FROM invoicepos, productbookingpos
WHERE invoicepos.quantity = (SELECT SUM(quantity)
                             FROM invoicepos
                             WHERE prod_id = 5453)
   OR productbookingpos.quantity = (SELECT SUM(quantity)
                                    FROM productbookingpos
                                    WHERE prod_id = 5453)
MfG
Thorsten
  Mit Zitat antworten Zitat