{"id":73356,"date":"2011-12-09T16:45:39","date_gmt":"2011-12-09T16:45:39","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/uncategorized\/simple-bar-chart-reports-with-sql-developer\/"},"modified":"2021-07-14T13:08:05","modified_gmt":"2021-07-14T13:08:05","slug":"simple-bar-chart-reports-with-sql-developer","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/databases\/oracle-databases\/simple-bar-chart-reports-with-sql-developer\/","title":{"rendered":"Simple Bar Chart Reports with SQL Developer"},"content":{"rendered":"<p>There are many good articles out there that go into detail for creating reports with Oracle SQL Developer. I was reading my predecessor\u2019s write up in Oracle Magazine (May 2007) on the subject, and keyed into the following snippet:<\/p>\n<blockquote>\n<p>Building a Chart<\/p>\n<p>When creating a report with the Chart style, the rule of thumb is to use SELECT group, series, data FROM table . So the basic tabular report you created earlier also has the right ingredients for the Chart style. Another good use of the Chart report style is for looking at your system information graphically. For example, to look at the trends of the datatypes used in columns in each table in a particular schema, create a new report, by setting Style to Chart and using the following query as the SQL:<\/p>\n<pre>select table_name, data_type,\r\ncount(data_type)\r\nfrom all_tab_columns\r\nwhere owner = \u2018HR\u2019\r\ngroup by table_name, data_type<\/pre>\n<\/blockquote>\n<p>Except in the chart report I wanted to create, I only had 2 columns. Here is the query I was using to feed data to the chart in SQL Developer:<\/p>\n<pre>SELECT country,count(*) FROM beer\r\ngroup by country\r\nhaving count(*) > 100\r\norder by 2 desc<\/pre>\n<p>Running MY query gives me data that looks like this:<\/p>\n<table>\n<tr>\n<td width=\"120\">COUNTRY<\/td>\n<td width=\"100\">COUNT(*)<\/td>\n<\/tr>\n<tr>\n<td>United States <\/td>\n<td>4140<\/td>\n<\/tr>\n<tr>\n<td>Germany <\/td>\n<td>1911<\/td>\n<\/tr>\n<tr>\n<td>United Kingdom <\/td>\n<td>639<\/td>\n<\/tr>\n<tr>\n<td>Russia <\/td>\n<td>544<\/td>\n<\/tr>\n<tr>\n<td>Canada <\/td>\n<td>435<\/td>\n<\/tr>\n<tr>\n<td>Japan <\/td>\n<td>348<\/td>\n<\/tr>\n<tr>\n<td>France <\/td>\n<td>267<\/td>\n<\/tr>\n<tr>\n<td>Brazil <\/td>\n<td>223<\/td>\n<\/tr>\n<tr>\n<td>Belgium <\/td>\n<td>198<\/td>\n<\/tr>\n<tr>\n<td>Australia <\/td>\n<td>195<\/td>\n<\/tr>\n<tr>\n<td>Italy <\/td>\n<td>172<\/td>\n<\/tr>\n<tr>\n<td>Poland <\/td>\n<td>171<\/td>\n<\/tr>\n<tr>\n<td>Czech Republic <\/td>\n<td>166<\/td>\n<\/tr>\n<tr>\n<td>China <\/td>\n<td>133<\/td>\n<\/tr>\n<tr>\n<td>Denmark <\/td>\n<td>130<\/td>\n<\/tr>\n<tr>\n<td>Austria <\/td>\n<td>128<\/td>\n<\/tr>\n<tr>\n<td>New Zealand <\/td>\n<td>104<\/td>\n<\/tr>\n<\/table>\n<p>Read the full article on my <a href=\"http:\/\/www.thatjeffsmith.com\/archive\/2011\/12\/simple-bar-chart-reports-with-sql-developer\/\" target=\"blank\">blog<\/a>to find out how to turn this into a chart report.<\/p>\n<p>edit.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are many good articles out there that go into detail for creating reports with Oracle SQL Developer. I was reading my predecessor\u2019s write up in Oracle Magazine (May 2007) on the subject, and keyed into the following snippet: Building a Chart When creating a report with the Chart style, the rule of thumb is to use SELECT group, series,&hellip;<\/p>\n","protected":false},"author":316194,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[143533],"tags":[],"coauthors":[],"class_list":["post-73356","post","type-post","status-publish","format-standard","hentry","category-oracle-databases"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/73356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/316194"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=73356"}],"version-history":[{"count":1,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/73356\/revisions"}],"predecessor-version":[{"id":91795,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/73356\/revisions\/91795"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=73356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=73356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=73356"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=73356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}