![]() |
AW: wo nichts ist kann man nichts zählen?
Ich bin in der zwischenzeit ein Stückchen weiter, Jeder meiner werte kann nicht vorhanden/null sein, darum und weil ich inzwischen
Code:
einsetze sieht das alles ein wenig anders aus:
with
Code:
Grund für die Umstellung auf den Union war, daß in der with-Subquery die Tabelle nicht mehr erkannt wurde solange "unten" mehr als 2 Tabellen "gejoind" wurden.
with bucnt as
( select count(distinct SR.casekey) cnt ,decode(substr(v_mk.Busunit,1,1),'T','A','W','W','K','K','A','A','sonstige') BU ....... ) select max(a_c) PT_LEBSRA ,max(k_c) PT_LEBSRK ,max(w_c) PT_LEBSRW ,max(misc_c) PT_LEBSRM_ ,max(a_c)+max(k_c)+max(w_c)+max(misc_c) PT_LEBSR from (select a_c,k_c,w_c,misc_c from (select nvl(bucnt.cnt,0) a_c ,0 w_c, 0 Misc_c from bucnt where bucnt.bu='A') full outer join (select nvl(cnt,0) k_c from bucnt where bucnt.bu='K') on 1=1 union select a_c,k_c,w_c,misc_c from (select nvl(cnt,0) w_c,0 k_c,0 a_c from bucnt where bucnt.bu='W') full outer join (select cnt misc_c from bucnt where (bucnt.bu<>'A' and bucnt.bu<>'K' and bucnt.bu<>'W') or bucnt.bu is null ) on 1=1 ) Etwas seltsam aber so ist es eben. Vorteil ist, daß meine "Ergebnistabelle immer mindestens einen 0-Wert hat(?). Gruß K-H |
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:25 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz