简体   繁体   中英

SQL Statement for Oracle Reports Builder Break Group

Oracle Reports Builder Break Group

Can any one explain how the example break group could be translated into an equivalent SQL statement?

Since some of you are unable to view the image, below is an ASCII diagram of the example:

     ----
     |Q_1|
     ----
      |
      |
----------------
|G_DEPARTMENT_ID|
----------------
| DEPARTMENT_ID |
| JOB_ID        |
----------------     
      |
      |
---------------
|G_EMPLOYEE_ID|
---------------
| EMPLOYEE_ID |
| FIRST_NAME  |
| LAST_NAME   |
| SALARY      |
---------------

It is an ordinary query:

select 
  -- fields that make G_DEPARTMENT_ID group
  department_id,
  job_id,
  -- fields that make G_EMPLOYEE_ID group
  employee_id,
  first_name,
  last_name,
  salary
from some_table
where ...

If you use Wizard to create a report (which is preferable way of doing it), it asks you what type of a report you want - that layout would be one of "Group" layouts ( above or left , doesn't matter). Then you'd select which fields should belong to the "Group above" (department_id and job_id). Wizard will also create layout that supports such a model and everything will work just fine.

If you're doing it manually, no problem as far as Data Model Layout is concerned: by default, everything (all fields) will be in the same group. Then drag DEPARTMENT_ID out of existing group and put it in between QUERY and G_EMPLOYEE_ID group - it'll automatically create a new group. Then move JOB_ID in there.

However, creating a Paper Layout is much more difficult, as you'll have to create new frames, fields, take care that everything is correctly contained in appropriate frame etc. Even if you know what you're doing, it is not straightforward job; perhaps it is easier to delete existing layout and let Wizard create it from scratch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM