By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
70 rows affected
grouping | classname | class |
---|---|---|
11011131402 | 246856681A1B41D | B467D086-86EB-438E-9D58-814DA9783508 |
11011131497 | 235FAAEF975046E | 54EB80BD-1DF9-41CC-92D2-71F4E4139BC9 |
11011131498 | 8DC0C20DFC194CD | 8AEBAC98-477B-48A6-B92E-97E3CCCFE494 |
11011131499 | 246856681A1B41D | 48E98324-A3ED-4B64-B721-AB22F12E8EED |
Warning: Null value is eliminated by an aggregate or other SET operation.
(No column name) |
---|
SELECT CATEGORIES,CLASSNAME,CLASS, [BLINDTRANSFER],[FORWARDKEY],[INTERRUPTIBLE],[LAST_UPDATE],[MAXPLAYTIME],[NAME],[PBXSWITCHING],[PLAYLASTPOS],[QTY_INVALIDKEYS],[QTY_NOINPUT],[RANDOMPLAYLIST],[STATISTIC],[TIMEOUT],[TYPE],[VAR_RESULT] FROM ( SELECT s.CATEGORIES,s.CLASSNAME,s.CLASS,s.KEYNAME,s.[KEY] FROM system s inner join ( select class as grouping , max(case when keyname = '#APPLICATION' then [key] end) as gclassname , max(case when keyname = '#VBOX' then [key] end) as gclass from system where keyname in ('#APPLICATION','#VBOX') group by class ) g on s.classname = g.gclassname and s.class = g.gclass ) sourcedata pivot ( max([key]) FOR [keyname] IN ([BLINDTRANSFER],[FORWARDKEY],[INTERRUPTIBLE],[LAST_UPDATE],[MAXPLAYTIME],[NAME],[PBXSWITCHING],[PLAYLASTPOS],[QTY_INVALIDKEYS],[QTY_NOINPUT],[RANDOMPLAYLIST],[STATISTIC],[TIMEOUT],[TYPE],[VAR_RESULT]) ) p |