Home » Fusion Middleware & Colab Suite » Business Intelligence » group every 5 records
|
Re: group every 5 records [message #686867 is a reply to message #686863] |
Fri, 27 January 2023 11:12   |
 |
Barbara Boehmer
Messages: 9105 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
I am not familiar with BI, so I don't know if there is some built-in method or not, so this is just responding to the question about the SQL query to provide a group id. It does not look like your data is in any particular order and you did not provide create and insert statements for sample data, so the following is just a brief simulation of one method, using Oracle demo data. There may also be newer better methods.
SCOTT@orcl_12.1.0.2.0> column project format a7
SCOTT@orcl_12.1.0.2.0> select ceil(rownum/5) grpid, substr(job,1,1) project, empno id
2 from emp
3 /
GRPID PROJECT ID
---------- ------- ----------
1 C 7369
1 S 7499
1 S 7521
1 M 7566
1 S 7654
2 M 7698
2 M 7782
2 A 7788
2 P 7839
2 S 7844
3 C 7876
3 C 7900
3 A 7902
3 C 7934
14 rows selected.
|
|
|
|
Goto Forum:
Current Time: Sat May 03 19:18:21 CDT 2025
|