Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to count split rows

Orcl ApexMar 6 2025

Hi All,

I have data as below - Under one header we have lines and lines can split e.g. under header 1 we see line 1 and 2 but split shows only one which means split is done for 1 line so count of lines is 2 and count of split is 1.

select ‘1’ header, ‘1’ line, ‘1’ split from dual union all

select ‘1’, ‘2’ , ‘1’ from dual union all

select ‘2’, ‘1’ , ‘1’ from dual

desired result -

line_count split_count

3 2

Comments
Post Details
Added on Mar 6 2025
5 comments
257 views