Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#5

AW: SUM Werte im Union addieren

  Alt 25. Apr 2012, 14:06
Oder in Worten: Ein Select auf ein Select (statt auf eine Tabelle):

SQL-Code:
SELECT
  sum(Feld1)
FROM
  (
    SELECT
      Felder
    FROM Tabelle1
    UNION
    SELECT
      Felder
    FROM Tabelle2
  )
GROUP BY Feld2
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat