Closed torjohannessen closed 1 year ago
Forslag til Select for å vise org.-struktur i KION
select a1.manager "KION sjef", a1.displayname "KION Avd.leder", (select count() from active_directory a where a.manager = a1.displayname) "# ansatte",' ', ' ', ' ' from active_directory a1, active_directory a2,active_directory a3 where a1.manager = 'Christer Kjellesvig' union select a1.manager "KION sjef", a1.displayname "KION Avd.leder", (select count() from active_directory a where a.manager = a2.displayname) "# ansatte",a2.displayname "Gr.leder", ' ', ' ' from active_directory a1, active_directory a2,active_directory a3 where a1.manager = 'Christer Kjellesvig' and a1.displayname = a2.manager union select a1.manager "KION sjef", a1.displayname "KION Avd.leder", (select count() from active_directory a where a.manager = a3.displayname) "# ansatte",a2.displayname "Gr.leder", a3.displayname "Ansatt", ' ' from active_directory a1, active_directory a2,active_directory a3 where a1.manager = 'Christer Kjellesvig' and a1.displayname = a2.manager and a2.displayname = a3.manager union select a1.manager "KION sjef", a1.displayname "KION Avd.leder", (select count() from active_directory a where a.manager = a4.displayname) "# ansatte", a2.displayname "Gr.leder", a3.displayname "Ansatt", a4.displayname from active_directory a1, active_directory a2,active_directory a3, active_directory a4 where a1.manager = 'Christer Kjellesvig' and a1.displayname = a2.manager and a2.displayname = a3.manager and a3.displayname = a4.manager order by 2,4,5,6
Må synkroniseres med det som er gjort på: https://github.com/orgs/knowit/projects/9/views/1?pane=issue&itemId=17937700
Denne er løst i Folk-webapp. derfor lukkes den her
Forslag til Select for å vise org.-struktur i KION
select a1.manager "KION sjef", a1.displayname "KION Avd.leder", (select count() from active_directory a where a.manager = a1.displayname) "# ansatte",' ', ' ', ' ' from active_directory a1, active_directory a2,active_directory a3 where a1.manager = 'Christer Kjellesvig' union select a1.manager "KION sjef", a1.displayname "KION Avd.leder", (select count() from active_directory a where a.manager = a2.displayname) "# ansatte",a2.displayname "Gr.leder", ' ', ' ' from active_directory a1, active_directory a2,active_directory a3 where a1.manager = 'Christer Kjellesvig' and a1.displayname = a2.manager union select a1.manager "KION sjef", a1.displayname "KION Avd.leder", (select count() from active_directory a where a.manager = a3.displayname) "# ansatte",a2.displayname "Gr.leder", a3.displayname "Ansatt", ' ' from active_directory a1, active_directory a2,active_directory a3 where a1.manager = 'Christer Kjellesvig' and a1.displayname = a2.manager and a2.displayname = a3.manager union select a1.manager "KION sjef", a1.displayname "KION Avd.leder", (select count() from active_directory a where a.manager = a4.displayname) "# ansatte", a2.displayname "Gr.leder", a3.displayname "Ansatt", a4.displayname from active_directory a1, active_directory a2,active_directory a3, active_directory a4 where a1.manager = 'Christer Kjellesvig' and a1.displayname = a2.manager and a2.displayname = a3.manager and a3.displayname = a4.manager order by 2,4,5,6