Connor and Chris will both be at AI World from October 12 to October 17 , the premier Oracle conference of 2025. If you're in Vegas, please come say Hi or pop into our sessions
Thanks for the question.
Asked: June 03, 2019 - 9:20 am UTC
Last updated: June 05, 2019 - 1:42 pm UTC
Version: 19.1.0.00.15
Viewed 10K+ times! This question is
with rws as ( select person.name, absence.start as dy, case when absence.type = 'Vacation' then 'V' when absence.type = 'Homeoffice' then 'HO' end as text from absence join person on person.id = absence.person) select * from rws pivot( min(text) for dy in ('06.03.2019', '06.04.2019') )
with dts as ( select sysdate+level/5 dt from dual connect by level <= 10 ), rws as ( select dense_rank () over ( order by trunc ( dt ) ) dr from dts ) select * from rws pivot ( count(*) for dr in ( 1, 2, 3, 4 ) ); 1 2 3 4 3 5 2 0
Analytic SQL got you confused? Check out Connor McDonald's complete video course.