Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select p.person_id, p.company_nr, p.last_name || ' ' || p.first_name as name,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')-touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+1 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM'))) as d01,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 1 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 1), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+2 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +2)) as d02,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 2 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 2), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+3 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +3)) as d03,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 3 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 3), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+4 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +4)) as d04,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 4 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 4), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+5 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +5)) as d05,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 5 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 5), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+6 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +6)) as d06,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 6 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 6), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+7 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +7)) as d07,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 7 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 7), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+8 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +8)) as d08,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 8 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 8), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+9 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +9)) as d09,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 9 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 9), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+10 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +10)) as d10,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 10 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 10), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+11 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +11)) as d11,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 11 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 11), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+12 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +12)) as d12,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 12 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 12), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+13 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +13)) as d13,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 13 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 13), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+14 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +14)) as d14,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 14 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 14), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+15 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +15)) as d15,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 15 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 15), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+16 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +16)) as d16,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 16 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 16), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+17 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +17)) as d17,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 17 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 17), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+18 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +18)) as d18,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 18 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 18), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+19 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +19)) as d19,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 19 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 19), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+20 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +20)) as d20,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 20 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 20), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+21 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +21)) as d21,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 21 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 21), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+22 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +22)) as d22,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 22 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 22), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+23 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +23)) as d23,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 23 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 23), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+24 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +24)) as d24,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 24 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 24), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+25 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +25)) as d25,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 25 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 25), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+26 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +26)) as d26,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 26 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 26), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+27 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +27)) as d27,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 27 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 27), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+28 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +28)) as d28,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 28 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 28), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+29 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +29)) as d29,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 29 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 29), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+30 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +30)) as d30,
- p_person.getNbrBadges(gup.person_id, trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 30 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+ 30), trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM')+31 -touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') +31)) as d31,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY'),'MM') ))) as c01,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 1 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 1 ))) as c02,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 2 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 2 ))) as c03,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 3 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 3 ))) as c04,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 4 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 4 ))) as c05,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 5 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 5 ))) as c06,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 6 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 6 ))) as c07,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 7 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 7 ))) as c08,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 8 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 8 ))) as c09,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 9 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 9 ))) as c10,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 10 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 10 ))) as c11,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 11 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 11 ))) as c12,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 12 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 12 ))) as c13,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 13 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 13 ))) as c14,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 14 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 14 ))) as c15,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 15 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 15 ))) as c16,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 16 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 16 ))) as c17,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 17 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 17 ))) as c18,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 18 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 18 ))) as c19,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 19 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 19 ))) as c20,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 20 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 20 ))) as c21,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 21 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 21 ))) as c22,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 22 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 22 ))) as c23,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 23 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 23 ))) as c24,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 24 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 24 ))) as c25,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 25 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 25 ))) as c26,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 26 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 26 ))) as c27,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 27 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 27 ))) as c28,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 28 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 28 ))) as c29,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 29 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 29 ))) as c30,
- p_pd_day.getFlagColor(gup.person_id, trunc ( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 30 - touserdatediff( trunc( to_date('20/09/2019','DD/MM/YYYY') ,'MM') + 30 ))) as c31
- from gu_person gup, person p
- where p.person_id = gup.person_id
- and p.vo_person_category_id = decode (-1, -1, p.vo_person_category_id, -1)
- and gup.gui_user_id = 101853
- and p.person_status_id=0
- order by name;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement