{"id":498,"date":"2008-11-13T14:48:11","date_gmt":"2008-11-13T12:48:11","guid":{"rendered":"http:\/\/blog.it4sport.de\/?p=498"},"modified":"2008-11-13T14:48:11","modified_gmt":"2008-11-13T12:48:11","slug":"rollup-oder-man-lernt-nie-aus","status":"publish","type":"post","link":"https:\/\/gmbd.de\/wordpress\/index.php\/2008\/11\/13\/rollup-oder-man-lernt-nie-aus\/","title":{"rendered":"Rollup oder man lernt nie aus"},"content":{"rendered":"<p>\t\t\t\tNeulich habe ich wieder was neues in Oracle SQL gelernt. Per <strong>rollup<\/strong> kann man die Summen von Gruppen abfragen. Sehr praktisch, denn die Funktion habe ich bis jetzt immer selbst nach programmiert. :-(. Rollup h\u00e4ngt pro Group by Variable eine weitere Zeile an das Ergebnis an in der die Summe alle Group by Werte steht. <\/p>\n<p>In Oracle sieht das so aus:<\/p>\n<pre lang=\"sql\">\nSELECT year, SUM(profit) profit FROM sales GROUP BY rollup(year);\n\n year  profit \n------ -------------\n 2000         4525 \n 2001         3010 \n NULL         7535 \n<\/pre>\n<p>In Mysql geht das auch aber so:<\/p>\n<pre lang=\"sql\">\nmysql> SELECT year, SUM(profit) as profit FROM sales GROUP BY year WITH ROLLUP;\n\n+------+-------------+\n| year | profit      |\n+------+-------------+\n| 2000 |        4525 |\n| 2001 |        3010 |\n| NULL |        7535 |\n+------+-------------+\n<\/pre>\n<p>Das schreib ich mir hier mal auf, sonst programmiere ich das das n\u00e4chste mal wieder nach&#8230; \t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neulich habe ich wieder was neues in Oracle SQL gelernt. Per rollup kann man die Summen von Gruppen abfragen. Sehr praktisch, denn die Funktion habe ich bis jetzt immer selbst nach programmiert. :-(. Rollup h\u00e4ngt pro Group by Variable eine weitere Zeile an das Ergebnis an in der die Summe alle Group by Werte steht.\u2026 <span class=\"read-more\"><a href=\"https:\/\/gmbd.de\/wordpress\/index.php\/2008\/11\/13\/rollup-oder-man-lernt-nie-aus\/\">Weiterlesen &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[36,48],"tags":[128,245,266,334],"_links":{"self":[{"href":"https:\/\/gmbd.de\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/498"}],"collection":[{"href":"https:\/\/gmbd.de\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gmbd.de\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gmbd.de\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gmbd.de\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=498"}],"version-history":[{"count":0,"href":"https:\/\/gmbd.de\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/498\/revisions"}],"wp:attachment":[{"href":"https:\/\/gmbd.de\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gmbd.de\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gmbd.de\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}