Skip to Main Content

APEX

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!

Using GROUP BY clause with a subgroup

Javier PFeb 8 2022 — edited Feb 12 2022

Hi All,
Am trying to do a query where the result groups the records by Condominiums and inside that group also group by apartments to show their notes with the dates of the notes.
I would like the result to be something like this:
Capture2.jpgThis is my query:
select n.nota_id, n.apt_id, c.cond_id, n.nota, n.created, n.created_by, a.apt, a.titular, a.telefono, a.cel, a.email, c.condominio, c.productor_id from cond_apartamentos_notas n join cond_apartamentos a on a.apt_id = n.apt_id join cond_condominios c on c.cond_id = a.cond_id where trunc(n.created) between :P11_DESDE and :P11_HASTA

Can a group by clause be used to get the desire results?
How can I use it and order it by cond_id and apt_id?
Thanks for the help on this!
Javier

This post has been answered by Javier P on Feb 8 2022
Jump to Answer
Comments
Post Details
Added on Feb 8 2022
15 comments
1,211 views