Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
Delphi 7 Enterprise
|
Re: Sum()-Daten aus 2 Tabellen in einer Query
21. Feb 2008, 21:01
Achso, nebeneinander...
SQL-Code:
SELECT p.id, p.number, billvalue, projecttime
FROM project p
LEFT JOIN (SELECT projectid AS id, SUM(billvalue) AS billvalue
FROM bill
GROUP BY projectid) a
ON p.id = a.id
LEFT JOIN (SELECT projectid AS id, SUM(projecttime) AS projecttime
FROM projecttime
GROUP BY projectid) b
ON p.id = b.id
Gruss
Thorsten
|
|
Zitat
|