Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
Delphi 7 Enterprise
|
Re: brauche dringend HILFE bei SQL-Abfrage
22. Apr 2006, 14: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
|
|
Zitat
|