Hallo!
Ich komme bei folgender Abfrage nicht weiter. Habe zwei Summen und möchte daraus ein ergebniss erzeugen. Also...
da bekomme ich als Ergebniss:
48 50
2 8
Ich hätte aber gern als Ergebniss:
50 58
Habe es so versucht, klappt aber nicht.
Wie kann ich das Problem lösen?
Ich komme bei folgender Abfrage nicht weiter. Habe zwei Summen und möchte daraus ein ergebniss erzeugen. Also...
Code:
SELECT SUM( forum_topics ) AS topic_total, SUM( forum_posts ) AS post_total FROM phpbb_forums UNION SELECT SUM( forum_topics ) AS topic_total, SUM( forum_posts ) AS post_total FROM allover_forums
48 50
2 8
Ich hätte aber gern als Ergebniss:
50 58
Habe es so versucht, klappt aber nicht.
Code:
CREATE TEMPORARY TABLE tmp_forums SELECT SUM( forum_topics ) AS topic_total, SUM( forum_posts ) AS post_total FROM phpbb_forums INSERT INTO TABLE SELECT SUM( forum_topics ) AS topic_total, SUM( forum_posts ) AS post_total FROM allover_forums SELECT SUM( topic_total ) AS topic_total, SUM( post_total ) AS post_total FROM tmp_forums
Comment