Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO #tt WITH(TABLOCK) (_Q_000_F_000_TYPE, _Q_000_F_000_RTRef, _Q_000_F_000_RRRef, _Q_000_F_001RRef, _Q_000_F_002, _Q_000_F_003RRef, _Q_000_F_004, _Q_000_F_005, _Q_000_F_006, _Q_000_F_007) SELECT
- T1.Fld11293_TYPE,
- T1.Fld11293_RTRef,
- T1.Fld11293_RRRef,
- T1.Fld11295RRef,
- (T1.Fld11302Turnover_ - T1.Fld11303Turnover_),
- T65.IDRRef,
- CASE WHEN CASE WHEN T1.Fld11290_TYPE = 0x08 AND T1.Fld11290_RTRef = 0x00000058 THEN T74._Fld12837 ELSE CAST(NULL AS BINARY(1)) END = 0x01 THEN (T1.Fld11302Turnover_ - T1.Fld11303Turnover_) ELSE 0.0 END,
- CASE WHEN (NOT ((CASE WHEN T1.Fld11290_TYPE = 0x08 AND T1.Fld11290_RTRef = 0x00000058 THEN T74._Fld12837 ELSE CAST(NULL AS BINARY(1)) END) = 0x01)) THEN (T1.Fld11302Turnover_ - T1.Fld11303Turnover_) ELSE 0.0 END,
- CAST(0.0 AS NUMERIC(21, 2)),
- CAST(NULL AS NUMERIC(21, 2))
- FROM (SELECT
- T2._Fld11293_TYPE AS Fld11293_TYPE,
- T2._Fld11293_RTRef AS Fld11293_RTRef,
- T2._Fld11293_RRRef AS Fld11293_RRRef,
- T2._Fld11295RRef AS Fld11295RRef,
- T2._Fld11290_TYPE AS Fld11290_TYPE,
- T2._Fld11290_RTRef AS Fld11290_RTRef,
- T2._Fld11290_RRRef AS Fld11290_RRRef,
- CAST(SUM(T2._Fld11303) AS NUMERIC(33, 8)) AS Fld11303Turnover_,
- CAST(SUM(T2._Fld11302) AS NUMERIC(33, 8)) AS Fld11302Turnover_
- FROM dbo._AccumRgTn11305 T2
- WHERE (((T2._Fld595 = ?)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Document233 T3
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000E9 AND T2._Fld11293_RRRef = T3._IDRRef) AND (T3._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document212 T4
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D4 AND T2._Fld11293_RRRef = T4._IDRRef) AND (T4._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document234 T5
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000EA AND T2._Fld11293_RRRef = T5._IDRRef) AND (T5._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document263 T6
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x00000107 AND T2._Fld11293_RRRef = T6._IDRRef) AND (T6._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document216 T7
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D8 AND T2._Fld11293_RRRef = T7._IDRRef) AND (T7._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document215 T8
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D7 AND T2._Fld11293_RRRef = T8._IDRRef) AND (T8._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document213 T9
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D5 AND T2._Fld11293_RRRef = T9._IDRRef) AND (T9._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document199 T10
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000C7 AND T2._Fld11293_RRRef = T10._IDRRef) AND (T10._Fld595 = ?)
- LEFT OUTER JOIN dbo._Reference42 T11
- ON ((CASE WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000E9 THEN T3._Fld4625RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D4 THEN T4._Fld3516RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000EA THEN T5._Fld4774RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x00000107 THEN T6._Fld6287RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D8 THEN T7._Fld3845RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D7 THEN T8._Fld3734RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D5 THEN T9._Fld3600RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000C7 THEN T10._Fld2840RRef ELSE CAST(NULL AS BINARY(16)) END = T11._IDRRef)) AND (T11._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T12
- INNER JOIN dbo._Reference21 T13
- ON (((T12._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T14
- WHERE ((T14._Fld595 = ?)) AND ((T14._Fld12065RRef = T12._IDRRef) AND (T14._Fld12066RRef = T13._IDRRef)))) AND T13._IDRRef IN
- (SELECT
- T15._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T15
- INNER JOIN dbo._InfoRg9937 T16
- ON ((T16._Fld9939_TYPE = 0x08 AND T16._Fld9939_RTRef = 0x00000095 AND T16._Fld9939_RRRef = ?) AND (T16._Fld9938_TYPE = T15._Fld784_TYPE AND T16._Fld9938_RTRef = T15._Fld784_RTRef AND T16._Fld9938_RRRef = T15._Fld784_RRRef))
- WHERE ((T15._Fld595 = ?)) AND (T16._Fld595 = ?)))
- WHERE ((T13._Fld595 = ?)) AND ((CASE WHEN T11._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T17
- WHERE ((T17._Fld595 = ?)) AND ((T17._Fld12072RRef = T13._IDRRef) AND (T17._Fld12073_TYPE = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x08 END AND T17._Fld12073_RTRef = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T17._Fld12073_RRRef = T11._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T18
- WHERE ((T18._Fld595 = ?)) AND ((T18._Fld12199RRef = T13._IDRRef) AND T18._Fld12200_TYPE = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x08 END AND T18._Fld12200_RTRef = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T18._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T2._Period >= ? AND T2._Period < ? AND (T2._Fld11303 <> ? OR T2._Fld11302 <> ?))
- GROUP BY T2._Fld11293_TYPE,
- T2._Fld11293_RTRef,
- T2._Fld11293_RRRef,
- T2._Fld11295RRef,
- T2._Fld11290_TYPE,
- T2._Fld11290_RTRef,
- T2._Fld11290_RRRef
- HAVING (CAST(SUM(T2._Fld11303) AS NUMERIC(33, 8))) <> 0.0 OR (CAST(SUM(T2._Fld11302) AS NUMERIC(33, 8))) <> 0.0) T1
- LEFT OUTER JOIN (SELECT
- T20._IDRRef AS IDRRef,
- T20._Fld4625RRef AS Fld4625RRef,
- T20._Fld595 AS Fld595_
- FROM dbo._Document233 T20
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T21
- ON ((T20._Fld4625RRef = T21._IDRRef)) AND (T21._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T22
- INNER JOIN dbo._Reference21 T23
- ON (((T22._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T24
- WHERE ((T24._Fld595 = ?)) AND ((T24._Fld12065RRef = T22._IDRRef) AND (T24._Fld12066RRef = T23._IDRRef)))) AND T23._IDRRef IN
- (SELECT
- T25._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T25
- INNER JOIN dbo._InfoRg9937 T26
- ON ((T26._Fld9939_TYPE = 0x08 AND T26._Fld9939_RTRef = 0x00000095 AND T26._Fld9939_RRRef = ?) AND (T26._Fld9938_TYPE = T25._Fld784_TYPE AND T26._Fld9938_RTRef = T25._Fld784_RTRef AND T26._Fld9938_RRRef = T25._Fld784_RRRef))
- WHERE ((T25._Fld595 = ?)) AND (T26._Fld595 = ?)))
- WHERE ((T23._Fld595 = ?)) AND ((CASE WHEN T21._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T27
- WHERE ((T27._Fld595 = ?)) AND ((T27._Fld12072RRef = T23._IDRRef) AND (T27._Fld12073_TYPE = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x08 END AND T27._Fld12073_RTRef = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T27._Fld12073_RRRef = T21._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T28
- WHERE ((T28._Fld595 = ?)) AND ((T28._Fld12199RRef = T23._IDRRef) AND T28._Fld12200_TYPE = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x08 END AND T28._Fld12200_RTRef = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T28._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T20._Fld595 = ?)) T19
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000E9 AND T1.Fld11293_RRRef = T19.IDRRef
- LEFT OUTER JOIN dbo._Document212 T29
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D4 AND T1.Fld11293_RRRef = T29._IDRRef) AND (T29._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T31._IDRRef AS IDRRef,
- T31._Fld4779RRef AS Fld4779RRef,
- T31._Fld595 AS Fld595_,
- T31._Fld4774RRef AS Fld4774RRef
- FROM dbo._Document234 T31
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T32
- ON ((T31._Fld4774RRef = T32._IDRRef)) AND (T32._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T33
- INNER JOIN dbo._Reference21 T34
- ON (((T33._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T35
- WHERE ((T35._Fld595 = ?)) AND ((T35._Fld12065RRef = T33._IDRRef) AND (T35._Fld12066RRef = T34._IDRRef)))) AND T34._IDRRef IN
- (SELECT
- T36._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T36
- INNER JOIN dbo._InfoRg9937 T37
- ON ((T37._Fld9939_TYPE = 0x08 AND T37._Fld9939_RTRef = 0x00000095 AND T37._Fld9939_RRRef = ?) AND (T37._Fld9938_TYPE = T36._Fld784_TYPE AND T37._Fld9938_RTRef = T36._Fld784_RTRef AND T37._Fld9938_RRRef = T36._Fld784_RRRef))
- WHERE ((T36._Fld595 = ?)) AND (T37._Fld595 = ?)))
- WHERE ((T34._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T38
- WHERE ((T38._Fld595 = ?)) AND ((T38._Fld12072RRef = T34._IDRRef) AND (T38._Fld12073_TYPE = 0x08 AND T38._Fld12073_RTRef = 0x0000001C AND T38._Fld12073_RRRef = T31._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T39
- WHERE ((T39._Fld595 = ?)) AND ((T39._Fld12199RRef = T34._IDRRef) AND T39._Fld12200_TYPE = 0x08 AND T39._Fld12200_RTRef = 0x0000001C AND (T39._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T32._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T40
- WHERE ((T40._Fld595 = ?)) AND ((T40._Fld12072RRef = T34._IDRRef) AND (T40._Fld12073_TYPE = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END AND T40._Fld12073_RTRef = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T40._Fld12073_RRRef = T32._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T41
- WHERE ((T41._Fld595 = ?)) AND ((T41._Fld12199RRef = T34._IDRRef) AND T41._Fld12200_TYPE = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END AND T41._Fld12200_RTRef = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T41._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T31._Fld595 = ?)) T30
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000EA AND T1.Fld11293_RRRef = T30.IDRRef
- LEFT OUTER JOIN dbo._Document263 T42
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x00000107 AND T1.Fld11293_RRRef = T42._IDRRef) AND (T42._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T44._IDRRef AS IDRRef,
- T44._Fld3845RRef AS Fld3845RRef,
- T44._Fld595 AS Fld595_
- FROM dbo._Document216 T44
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T45
- ON ((T44._Fld3845RRef = T45._IDRRef)) AND (T45._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T46
- INNER JOIN dbo._Reference21 T47
- ON (((T46._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T48
- WHERE ((T48._Fld595 = ?)) AND ((T48._Fld12065RRef = T46._IDRRef) AND (T48._Fld12066RRef = T47._IDRRef)))) AND T47._IDRRef IN
- (SELECT
- T49._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T49
- INNER JOIN dbo._InfoRg9937 T50
- ON ((T50._Fld9939_TYPE = 0x08 AND T50._Fld9939_RTRef = 0x00000095 AND T50._Fld9939_RRRef = ?) AND (T50._Fld9938_TYPE = T49._Fld784_TYPE AND T50._Fld9938_RTRef = T49._Fld784_RTRef AND T50._Fld9938_RRRef = T49._Fld784_RRRef))
- WHERE ((T49._Fld595 = ?)) AND (T50._Fld595 = ?)))
- WHERE ((T47._Fld595 = ?)) AND ((CASE WHEN T45._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T51
- WHERE ((T51._Fld595 = ?)) AND ((T51._Fld12072RRef = T47._IDRRef) AND (T51._Fld12073_TYPE = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x08 END AND T51._Fld12073_RTRef = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T51._Fld12073_RRRef = T45._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T52
- WHERE ((T52._Fld595 = ?)) AND ((T52._Fld12199RRef = T47._IDRRef) AND T52._Fld12200_TYPE = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x08 END AND T52._Fld12200_RTRef = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T52._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T44._Fld595 = ?)) T43
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D8 AND T1.Fld11293_RRRef = T43.IDRRef
- LEFT OUTER JOIN (SELECT
- T54._Fld595 AS Fld595_,
- T54._IDRRef AS IDRRef,
- T54._Fld3734RRef AS Fld3734RRef
- FROM dbo._Document215 T54
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T55
- ON ((T54._Fld3734RRef = T55._IDRRef)) AND (T55._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T56
- INNER JOIN dbo._Reference21 T57
- ON (((T56._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T58
- WHERE ((T58._Fld595 = ?)) AND ((T58._Fld12065RRef = T56._IDRRef) AND (T58._Fld12066RRef = T57._IDRRef)))) AND T57._IDRRef IN
- (SELECT
- T59._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T59
- INNER JOIN dbo._InfoRg9937 T60
- ON ((T60._Fld9939_TYPE = 0x08 AND T60._Fld9939_RTRef = 0x00000095 AND T60._Fld9939_RRRef = ?) AND (T60._Fld9938_TYPE = T59._Fld784_TYPE AND T60._Fld9938_RTRef = T59._Fld784_RTRef AND T60._Fld9938_RRRef = T59._Fld784_RRRef))
- WHERE ((T59._Fld595 = ?)) AND (T60._Fld595 = ?)))
- WHERE ((T57._Fld595 = ?)) AND ((CASE WHEN T55._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T61
- WHERE ((T61._Fld595 = ?)) AND ((T61._Fld12072RRef = T57._IDRRef) AND (T61._Fld12073_TYPE = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x08 END AND T61._Fld12073_RTRef = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T61._Fld12073_RRRef = T55._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T62
- WHERE ((T62._Fld595 = ?)) AND ((T62._Fld12199RRef = T57._IDRRef) AND T62._Fld12200_TYPE = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x08 END AND T62._Fld12200_RTRef = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T62._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T54._Fld595 = ?)) T53
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D7 AND T1.Fld11293_RRRef = T53.IDRRef
- LEFT OUTER JOIN dbo._Document213 T63
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D5 AND T1.Fld11293_RRRef = T63._IDRRef) AND (T63._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document199 T64
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000C7 AND T1.Fld11293_RRRef = T64._IDRRef) AND (T64._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T66._IDRRef AS IDRRef,
- T66._Fld12836RRef AS Fld12836RRef,
- T66._Fld595 AS Fld595_,
- T66._Folder AS Folder_
- FROM dbo._Reference42 T66
- WHERE ((((T66._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T67
- INNER JOIN dbo._Reference21 T68
- ON (((T67._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T69
- WHERE ((T69._Fld595 = ?)) AND ((T69._Fld12065RRef = T67._IDRRef) AND (T69._Fld12066RRef = T68._IDRRef)))) AND T68._IDRRef IN
- (SELECT
- T70._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T70
- INNER JOIN dbo._InfoRg9937 T71
- ON ((T71._Fld9939_TYPE = 0x08 AND T71._Fld9939_RTRef = 0x00000095 AND T71._Fld9939_RRRef = ?) AND (T71._Fld9938_TYPE = T70._Fld784_TYPE AND T71._Fld9938_RTRef = T70._Fld784_RTRef AND T71._Fld9938_RRRef = T70._Fld784_RRRef))
- WHERE ((T70._Fld595 = ?)) AND (T71._Fld595 = ?)))
- WHERE ((T68._Fld595 = ?)) AND ((CASE WHEN T66._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T72
- WHERE ((T72._Fld595 = ?)) AND ((T72._Fld12072RRef = T68._IDRRef) AND (T72._Fld12073_TYPE = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END AND T72._Fld12073_RTRef = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T72._Fld12073_RRRef = T66._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T73
- WHERE ((T73._Fld595 = ?)) AND ((T73._Fld12199RRef = T68._IDRRef) AND T73._Fld12200_TYPE = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END AND T73._Fld12200_RTRef = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T73._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T66._Fld595 = ?)) T65
- ON (CASE WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000E9 THEN T19.Fld4625RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D4 THEN T29._Fld3516RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000EA THEN T30.Fld4774RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x00000107 THEN T42._Fld6287RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D8 THEN T43.Fld3845RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D7 THEN T53.Fld3734RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D5 THEN T63._Fld3600RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000C7 THEN T64._Fld2840RRef ELSE CAST(NULL AS BINARY(16)) END = T65.IDRRef)
- LEFT OUTER JOIN dbo._Reference88 T74
- ON (T1.Fld11290_TYPE = 0x08 AND T1.Fld11290_RTRef = 0x00000058 AND T1.Fld11290_RRRef = T74._IDRRef) AND (T74._Fld595 = ?)
- UNION ALL SELECT
- T75.Fld10332_TYPE,
- T75.Fld10332_RTRef,
- T75.Fld10332_RRRef,
- T75.Fld10328RRef,
- CAST(NULL AS NUMERIC(28, 2)),
- T75.Fld10330RRef,
- CAST(NULL AS NUMERIC(28, 2)),
- CAST(NULL AS NUMERIC(28, 2)),
- T75.Fld10334Expense_,
- CAST(NULL AS NUMERIC(21, 2))
- FROM (SELECT
- T76._RecorderTRef AS RecorderTRef,
- T76._RecorderRRef AS RecorderRRef,
- T76._Fld10332_TYPE AS Fld10332_TYPE,
- T76._Fld10332_RTRef AS Fld10332_RTRef,
- T76._Fld10332_RRRef AS Fld10332_RRRef,
- T76._Fld10328RRef AS Fld10328RRef,
- T76._Fld10330RRef AS Fld10330RRef,
- CAST(SUM(CASE WHEN T76._RecordKind = 0.0 THEN 0.0 ELSE T76._Fld10334 END) AS NUMERIC(27, 8)) AS Fld10334Expense_
- FROM dbo._AccumRg10327 T76
- WHERE (((T76._Fld595 = ?)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T77
- ON ((T76._Fld10330RRef = T77._IDRRef)) AND (T77._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T78
- INNER JOIN dbo._Reference21 T79
- ON (((T78._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T80
- WHERE ((T80._Fld595 = ?)) AND ((T80._Fld12065RRef = T78._IDRRef) AND (T80._Fld12066RRef = T79._IDRRef)))) AND T79._IDRRef IN
- (SELECT
- T81._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T81
- INNER JOIN dbo._InfoRg9937 T82
- ON ((T82._Fld9939_TYPE = 0x08 AND T82._Fld9939_RTRef = 0x00000095 AND T82._Fld9939_RRRef = ?) AND (T82._Fld9938_TYPE = T81._Fld784_TYPE AND T82._Fld9938_RTRef = T81._Fld784_RTRef AND T82._Fld9938_RRRef = T81._Fld784_RRRef))
- WHERE ((T81._Fld595 = ?)) AND (T82._Fld595 = ?)))
- WHERE ((T79._Fld595 = ?)) AND ((CASE WHEN T77._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T77._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T83
- WHERE ((T83._Fld595 = ?)) AND ((T83._Fld12072RRef = T79._IDRRef) AND (T83._Fld12073_TYPE = CASE WHEN T77._Fld12836RRef IS NOT NULL THEN 0x08 END AND T83._Fld12073_RTRef = CASE WHEN T77._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T83._Fld12073_RRRef = T77._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T84
- WHERE ((T84._Fld595 = ?)) AND ((T84._Fld12199RRef = T79._IDRRef) AND T84._Fld12200_TYPE = CASE WHEN T77._Fld12836RRef IS NOT NULL THEN 0x08 END AND T84._Fld12200_RTRef = CASE WHEN T77._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T84._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T76._Period >= ? AND T76._Period <= ? AND T76._Active = 0x01 AND T76._RecordKind = ?)
- GROUP BY T76._RecorderTRef,
- T76._RecorderRRef,
- T76._Fld10332_TYPE,
- T76._Fld10332_RTRef,
- T76._Fld10332_RRRef,
- T76._Fld10328RRef,
- T76._Fld10330RRef
- HAVING (CAST(SUM(CASE WHEN T76._RecordKind = 0.0 THEN 0.0 ELSE T76._Fld10334 END) AS NUMERIC(27, 8))) <> 0.0) T75
- WHERE (T75.RecorderTRef = 0x000000D3)
- UNION ALL SELECT
- T85.Fld10540_TYPE,
- T85.Fld10540_RTRef,
- T85.Fld10540_RRRef,
- T85.Fld10536RRef,
- CAST(NULL AS NUMERIC(28, 2)),
- T85.Fld10538RRef,
- CAST(NULL AS NUMERIC(28, 2)),
- CAST(NULL AS NUMERIC(28, 2)),
- T85.Fld10544Expense_,
- CAST(NULL AS NUMERIC(21, 2))
- FROM (SELECT
- T86._RecorderTRef AS RecorderTRef,
- T86._RecorderRRef AS RecorderRRef,
- T86._Fld10540_TYPE AS Fld10540_TYPE,
- T86._Fld10540_RTRef AS Fld10540_RTRef,
- T86._Fld10540_RRRef AS Fld10540_RRRef,
- T86._Fld10538RRef AS Fld10538RRef,
- T86._Fld10536RRef AS Fld10536RRef,
- CAST(SUM(CASE WHEN T86._RecordKind = 0.0 THEN 0.0 ELSE T86._Fld10544 END) AS NUMERIC(27, 8)) AS Fld10544Expense_
- FROM dbo._AccumRg10535 T86
- WHERE (((T86._Fld595 = ?)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T87
- ON ((T86._Fld10538RRef = T87._IDRRef)) AND (T87._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T88
- INNER JOIN dbo._Reference21 T89
- ON (((T88._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T90
- WHERE ((T90._Fld595 = ?)) AND ((T90._Fld12065RRef = T88._IDRRef) AND (T90._Fld12066RRef = T89._IDRRef)))) AND T89._IDRRef IN
- (SELECT
- T91._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T91
- INNER JOIN dbo._InfoRg9937 T92
- ON ((T92._Fld9939_TYPE = 0x08 AND T92._Fld9939_RTRef = 0x00000095 AND T92._Fld9939_RRRef = ?) AND (T92._Fld9938_TYPE = T91._Fld784_TYPE AND T92._Fld9938_RTRef = T91._Fld784_RTRef AND T92._Fld9938_RRRef = T91._Fld784_RRRef))
- WHERE ((T91._Fld595 = ?)) AND (T92._Fld595 = ?)))
- WHERE ((T89._Fld595 = ?)) AND ((CASE WHEN T87._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T87._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T93
- WHERE ((T93._Fld595 = ?)) AND ((T93._Fld12072RRef = T89._IDRRef) AND (T93._Fld12073_TYPE = CASE WHEN T87._Fld12836RRef IS NOT NULL THEN 0x08 END AND T93._Fld12073_RTRef = CASE WHEN T87._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T93._Fld12073_RRRef = T87._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T94
- WHERE ((T94._Fld595 = ?)) AND ((T94._Fld12199RRef = T89._IDRRef) AND T94._Fld12200_TYPE = CASE WHEN T87._Fld12836RRef IS NOT NULL THEN 0x08 END AND T94._Fld12200_RTRef = CASE WHEN T87._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T94._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T86._Period >= ? AND T86._Period <= ? AND T86._Active = 0x01 AND T86._RecordKind = ?)
- GROUP BY T86._RecorderTRef,
- T86._RecorderRRef,
- T86._Fld10540_TYPE,
- T86._Fld10540_RTRef,
- T86._Fld10540_RRRef,
- T86._Fld10538RRef,
- T86._Fld10536RRef
- HAVING (CAST(SUM(CASE WHEN T86._RecordKind = 0.0 THEN 0.0 ELSE T86._Fld10544 END) AS NUMERIC(27, 8))) <> 0.0) T85
- LEFT OUTER JOIN (SELECT
- T96._IDRRef AS IDRRef,
- T96._Fld4634_TYPE AS Fld4634_TYPE,
- T96._Fld4634_RTRef AS Fld4634_RTRef,
- T96._Fld4634_RRRef AS Fld4634_RRRef,
- T96._Fld4625RRef AS Fld4625RRef,
- T96._Fld595 AS Fld595_
- FROM dbo._Document233 T96
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T97
- ON ((T96._Fld4625RRef = T97._IDRRef)) AND (T97._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T98
- INNER JOIN dbo._Reference21 T99
- ON (((T98._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T100
- WHERE ((T100._Fld595 = ?)) AND ((T100._Fld12065RRef = T98._IDRRef) AND (T100._Fld12066RRef = T99._IDRRef)))) AND T99._IDRRef IN
- (SELECT
- T101._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T101
- INNER JOIN dbo._InfoRg9937 T102
- ON ((T102._Fld9939_TYPE = 0x08 AND T102._Fld9939_RTRef = 0x00000095 AND T102._Fld9939_RRRef = ?) AND (T102._Fld9938_TYPE = T101._Fld784_TYPE AND T102._Fld9938_RTRef = T101._Fld784_RTRef AND T102._Fld9938_RRRef = T101._Fld784_RRRef))
- WHERE ((T101._Fld595 = ?)) AND (T102._Fld595 = ?)))
- WHERE ((T99._Fld595 = ?)) AND ((CASE WHEN T97._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T97._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T103
- WHERE ((T103._Fld595 = ?)) AND ((T103._Fld12072RRef = T99._IDRRef) AND (T103._Fld12073_TYPE = CASE WHEN T97._Fld12836RRef IS NOT NULL THEN 0x08 END AND T103._Fld12073_RTRef = CASE WHEN T97._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T103._Fld12073_RRRef = T97._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T104
- WHERE ((T104._Fld595 = ?)) AND ((T104._Fld12199RRef = T99._IDRRef) AND T104._Fld12200_TYPE = CASE WHEN T97._Fld12836RRef IS NOT NULL THEN 0x08 END AND T104._Fld12200_RTRef = CASE WHEN T97._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T104._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T96._Fld595 = ?)) T95
- ON T85.RecorderTRef = 0x000000E9 AND T85.RecorderRRef = T95.IDRRef
- LEFT OUTER JOIN dbo._Document212 T105
- ON (T85.RecorderTRef = 0x000000D4 AND T85.RecorderRRef = T105._IDRRef) AND (T105._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T107._IDRRef AS IDRRef,
- T107._Fld4779RRef AS Fld4779RRef,
- T107._Fld595 AS Fld595_,
- T107._Fld4782_TYPE AS Fld4782_TYPE,
- T107._Fld4782_RTRef AS Fld4782_RTRef,
- T107._Fld4782_RRRef AS Fld4782_RRRef,
- T107._Fld4774RRef AS Fld4774RRef
- FROM dbo._Document234 T107
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T108
- ON ((T107._Fld4774RRef = T108._IDRRef)) AND (T108._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T109
- INNER JOIN dbo._Reference21 T110
- ON (((T109._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T111
- WHERE ((T111._Fld595 = ?)) AND ((T111._Fld12065RRef = T109._IDRRef) AND (T111._Fld12066RRef = T110._IDRRef)))) AND T110._IDRRef IN
- (SELECT
- T112._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T112
- INNER JOIN dbo._InfoRg9937 T113
- ON ((T113._Fld9939_TYPE = 0x08 AND T113._Fld9939_RTRef = 0x00000095 AND T113._Fld9939_RRRef = ?) AND (T113._Fld9938_TYPE = T112._Fld784_TYPE AND T113._Fld9938_RTRef = T112._Fld784_RTRef AND T113._Fld9938_RRRef = T112._Fld784_RRRef))
- WHERE ((T112._Fld595 = ?)) AND (T113._Fld595 = ?)))
- WHERE ((T110._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T114
- WHERE ((T114._Fld595 = ?)) AND ((T114._Fld12072RRef = T110._IDRRef) AND (T114._Fld12073_TYPE = 0x08 AND T114._Fld12073_RTRef = 0x0000001C AND T114._Fld12073_RRRef = T107._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T115
- WHERE ((T115._Fld595 = ?)) AND ((T115._Fld12199RRef = T110._IDRRef) AND T115._Fld12200_TYPE = 0x08 AND T115._Fld12200_RTRef = 0x0000001C AND (T115._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T108._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T108._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T116
- WHERE ((T116._Fld595 = ?)) AND ((T116._Fld12072RRef = T110._IDRRef) AND (T116._Fld12073_TYPE = CASE WHEN T108._Fld12836RRef IS NOT NULL THEN 0x08 END AND T116._Fld12073_RTRef = CASE WHEN T108._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T116._Fld12073_RRRef = T108._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T117
- WHERE ((T117._Fld595 = ?)) AND ((T117._Fld12199RRef = T110._IDRRef) AND T117._Fld12200_TYPE = CASE WHEN T108._Fld12836RRef IS NOT NULL THEN 0x08 END AND T117._Fld12200_RTRef = CASE WHEN T108._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T117._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T107._Fld595 = ?)) T106
- ON T85.RecorderTRef = 0x000000EA AND T85.RecorderRRef = T106.IDRRef
- LEFT OUTER JOIN dbo._Document253 T118
- ON (T85.RecorderTRef = 0x000000FD AND T85.RecorderRRef = T118._IDRRef) AND (T118._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T120._IDRRef AS IDRRef,
- T120._Fld595 AS Fld595_,
- T120._Fld6145_TYPE AS Fld6145_TYPE,
- T120._Fld6145_RTRef AS Fld6145_RTRef,
- T120._Fld6145_RRRef AS Fld6145_RRRef,
- T120._Fld6139RRef AS Fld6139RRef
- FROM dbo._Document259 T120
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T121
- ON ((T120._Fld6139RRef = T121._IDRRef)) AND (T121._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T122
- INNER JOIN dbo._Reference21 T123
- ON (((T122._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T124
- WHERE ((T124._Fld595 = ?)) AND ((T124._Fld12065RRef = T122._IDRRef) AND (T124._Fld12066RRef = T123._IDRRef)))) AND T123._IDRRef IN
- (SELECT
- T125._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T125
- INNER JOIN dbo._InfoRg9937 T126
- ON ((T126._Fld9939_TYPE = 0x08 AND T126._Fld9939_RTRef = 0x00000095 AND T126._Fld9939_RRRef = ?) AND (T126._Fld9938_TYPE = T125._Fld784_TYPE AND T126._Fld9938_RTRef = T125._Fld784_RTRef AND T126._Fld9938_RRRef = T125._Fld784_RRRef))
- WHERE ((T125._Fld595 = ?)) AND (T126._Fld595 = ?)))
- WHERE ((T123._Fld595 = ?)) AND ((CASE WHEN T121._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T121._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T127
- WHERE ((T127._Fld595 = ?)) AND ((T127._Fld12072RRef = T123._IDRRef) AND (T127._Fld12073_TYPE = CASE WHEN T121._Fld12836RRef IS NOT NULL THEN 0x08 END AND T127._Fld12073_RTRef = CASE WHEN T121._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T127._Fld12073_RRRef = T121._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T128
- WHERE ((T128._Fld595 = ?)) AND ((T128._Fld12199RRef = T123._IDRRef) AND T128._Fld12200_TYPE = CASE WHEN T121._Fld12836RRef IS NOT NULL THEN 0x08 END AND T128._Fld12200_RTRef = CASE WHEN T121._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T128._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T120._Fld595 = ?)) T119
- ON T85.RecorderTRef = 0x00000103 AND T85.RecorderRRef = T119.IDRRef
- LEFT OUTER JOIN (SELECT
- T130._IDRRef AS IDRRef,
- T130._Fld3845RRef AS Fld3845RRef,
- T130._Fld3852_TYPE AS Fld3852_TYPE,
- T130._Fld3852_RTRef AS Fld3852_RTRef,
- T130._Fld3852_RRRef AS Fld3852_RRRef,
- T130._Fld595 AS Fld595_
- FROM dbo._Document216 T130
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T131
- ON ((T130._Fld3845RRef = T131._IDRRef)) AND (T131._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T132
- INNER JOIN dbo._Reference21 T133
- ON (((T132._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T134
- WHERE ((T134._Fld595 = ?)) AND ((T134._Fld12065RRef = T132._IDRRef) AND (T134._Fld12066RRef = T133._IDRRef)))) AND T133._IDRRef IN
- (SELECT
- T135._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T135
- INNER JOIN dbo._InfoRg9937 T136
- ON ((T136._Fld9939_TYPE = 0x08 AND T136._Fld9939_RTRef = 0x00000095 AND T136._Fld9939_RRRef = ?) AND (T136._Fld9938_TYPE = T135._Fld784_TYPE AND T136._Fld9938_RTRef = T135._Fld784_RTRef AND T136._Fld9938_RRRef = T135._Fld784_RRRef))
- WHERE ((T135._Fld595 = ?)) AND (T136._Fld595 = ?)))
- WHERE ((T133._Fld595 = ?)) AND ((CASE WHEN T131._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T131._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T137
- WHERE ((T137._Fld595 = ?)) AND ((T137._Fld12072RRef = T133._IDRRef) AND (T137._Fld12073_TYPE = CASE WHEN T131._Fld12836RRef IS NOT NULL THEN 0x08 END AND T137._Fld12073_RTRef = CASE WHEN T131._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T137._Fld12073_RRRef = T131._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T138
- WHERE ((T138._Fld595 = ?)) AND ((T138._Fld12199RRef = T133._IDRRef) AND T138._Fld12200_TYPE = CASE WHEN T131._Fld12836RRef IS NOT NULL THEN 0x08 END AND T138._Fld12200_RTRef = CASE WHEN T131._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T138._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T130._Fld595 = ?)) T129
- ON T85.RecorderTRef = 0x000000D8 AND T85.RecorderRRef = T129.IDRRef
- LEFT OUTER JOIN (SELECT
- T140._IDRRef AS IDRRef,
- T140._Fld3325_TYPE AS Fld3325_TYPE,
- T140._Fld3325_RTRef AS Fld3325_RTRef,
- T140._Fld3325_RRRef AS Fld3325_RRRef,
- T140._Fld595 AS Fld595_
- FROM dbo._Document209 T140
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Document211 T141
- ON (T140._Fld3325_TYPE = 0x08 AND T140._Fld3325_RTRef = 0x000000D3 AND T140._Fld3325_RRRef = T141._IDRRef) AND (T141._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document210 T142
- ON (T140._Fld3325_TYPE = 0x08 AND T140._Fld3325_RTRef = 0x000000D2 AND T140._Fld3325_RRRef = T142._IDRRef) AND (T142._Fld595 = ?)
- LEFT OUTER JOIN dbo._Reference42 T143
- ON ((CASE WHEN T140._Fld3325_TYPE = 0x08 AND T140._Fld3325_RTRef = 0x000000D3 THEN T141._Fld3438RRef WHEN T140._Fld3325_TYPE = 0x08 AND T140._Fld3325_RTRef = 0x000000D2 THEN T142._Fld3343RRef ELSE CAST(NULL AS BINARY(16)) END = T143._IDRRef)) AND (T143._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T144
- INNER JOIN dbo._Reference21 T145
- ON (((T144._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T146
- WHERE ((T146._Fld595 = ?)) AND ((T146._Fld12065RRef = T144._IDRRef) AND (T146._Fld12066RRef = T145._IDRRef)))) AND T145._IDRRef IN
- (SELECT
- T147._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T147
- INNER JOIN dbo._InfoRg9937 T148
- ON ((T148._Fld9939_TYPE = 0x08 AND T148._Fld9939_RTRef = 0x00000095 AND T148._Fld9939_RRRef = ?) AND (T148._Fld9938_TYPE = T147._Fld784_TYPE AND T148._Fld9938_RTRef = T147._Fld784_RTRef AND T148._Fld9938_RRRef = T147._Fld784_RRRef))
- WHERE ((T147._Fld595 = ?)) AND (T148._Fld595 = ?)))
- WHERE ((T145._Fld595 = ?)) AND ((CASE WHEN T143._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T143._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T149
- WHERE ((T149._Fld595 = ?)) AND ((T149._Fld12072RRef = T145._IDRRef) AND (T149._Fld12073_TYPE = CASE WHEN T143._Fld12836RRef IS NOT NULL THEN 0x08 END AND T149._Fld12073_RTRef = CASE WHEN T143._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T149._Fld12073_RRRef = T143._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T150
- WHERE ((T150._Fld595 = ?)) AND ((T150._Fld12199RRef = T145._IDRRef) AND T150._Fld12200_TYPE = CASE WHEN T143._Fld12836RRef IS NOT NULL THEN 0x08 END AND T150._Fld12200_RTRef = CASE WHEN T143._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T150._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T140._Fld595 = ?)) T139
- ON T85.RecorderTRef = 0x000000D1 AND T85.RecorderRRef = T139.IDRRef
- LEFT OUTER JOIN (SELECT
- T152._Fld595 AS Fld595_,
- T152._IDRRef AS IDRRef,
- T152._Fld3734RRef AS Fld3734RRef,
- T152._Fld3739RRef AS Fld3739RRef
- FROM dbo._Document215 T152
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T153
- ON ((T152._Fld3734RRef = T153._IDRRef)) AND (T153._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T154
- INNER JOIN dbo._Reference21 T155
- ON (((T154._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T156
- WHERE ((T156._Fld595 = ?)) AND ((T156._Fld12065RRef = T154._IDRRef) AND (T156._Fld12066RRef = T155._IDRRef)))) AND T155._IDRRef IN
- (SELECT
- T157._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T157
- INNER JOIN dbo._InfoRg9937 T158
- ON ((T158._Fld9939_TYPE = 0x08 AND T158._Fld9939_RTRef = 0x00000095 AND T158._Fld9939_RRRef = ?) AND (T158._Fld9938_TYPE = T157._Fld784_TYPE AND T158._Fld9938_RTRef = T157._Fld784_RTRef AND T158._Fld9938_RRRef = T157._Fld784_RRRef))
- WHERE ((T157._Fld595 = ?)) AND (T158._Fld595 = ?)))
- WHERE ((T155._Fld595 = ?)) AND ((CASE WHEN T153._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T153._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T159
- WHERE ((T159._Fld595 = ?)) AND ((T159._Fld12072RRef = T155._IDRRef) AND (T159._Fld12073_TYPE = CASE WHEN T153._Fld12836RRef IS NOT NULL THEN 0x08 END AND T159._Fld12073_RTRef = CASE WHEN T153._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T159._Fld12073_RRRef = T153._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T160
- WHERE ((T160._Fld595 = ?)) AND ((T160._Fld12199RRef = T155._IDRRef) AND T160._Fld12200_TYPE = CASE WHEN T153._Fld12836RRef IS NOT NULL THEN 0x08 END AND T160._Fld12200_RTRef = CASE WHEN T153._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T160._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T152._Fld595 = ?)) T151
- ON T85.RecorderTRef = 0x000000D7 AND T85.RecorderRRef = T151.IDRRef
- LEFT OUTER JOIN (SELECT
- T162._Fld6057_TYPE AS Fld6057_TYPE,
- T162._Fld6057_RTRef AS Fld6057_RTRef,
- T162._Fld6057_RRRef AS Fld6057_RRRef,
- T162._IDRRef AS IDRRef,
- T162._Fld6064RRef AS Fld6064RRef,
- T162._Fld595 AS Fld595_
- FROM dbo._Document258 T162
- WHERE ((EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T163
- INNER JOIN dbo._Reference21 T164
- ON (((T163._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T165
- WHERE ((T165._Fld595 = ?)) AND ((T165._Fld12065RRef = T163._IDRRef) AND (T165._Fld12066RRef = T164._IDRRef)))) AND T164._IDRRef IN
- (SELECT
- T166._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T166
- INNER JOIN dbo._InfoRg9937 T167
- ON ((T167._Fld9939_TYPE = 0x08 AND T167._Fld9939_RTRef = 0x00000095 AND T167._Fld9939_RRRef = ?) AND (T167._Fld9938_TYPE = T166._Fld784_TYPE AND T167._Fld9938_RTRef = T166._Fld784_RTRef AND T167._Fld9938_RRRef = T166._Fld784_RRRef))
- WHERE ((T166._Fld595 = ?)) AND (T167._Fld595 = ?)))
- WHERE ((T164._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T168
- WHERE ((T168._Fld595 = ?)) AND ((T168._Fld12072RRef = T164._IDRRef) AND (T168._Fld12073_TYPE = 0x08 AND T168._Fld12073_RTRef = 0x0000006E AND T168._Fld12073_RRRef = T162._Fld6064RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T169
- WHERE ((T169._Fld595 = ?)) AND ((T169._Fld12199RRef = T164._IDRRef) AND T169._Fld12200_TYPE = 0x08 AND T169._Fld12200_RTRef = 0x0000006E AND (T169._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) AND (T162._Fld595 = ?)) T161
- ON T85.RecorderTRef = 0x00000102 AND T85.RecorderRRef = T161.IDRRef
- LEFT OUTER JOIN (SELECT
- T171._IDRRef AS IDRRef,
- T171._Fld3438RRef AS Fld3438RRef,
- T171._Fld3444_TYPE AS Fld3444_TYPE,
- T171._Fld3444_RTRef AS Fld3444_RTRef,
- T171._Fld3444_RRRef AS Fld3444_RRRef,
- T171._Fld595 AS Fld595_
- FROM dbo._Document211 T171
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T172
- ON ((T171._Fld3438RRef = T172._IDRRef)) AND (T172._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T173
- INNER JOIN dbo._Reference21 T174
- ON (((T173._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T175
- WHERE ((T175._Fld595 = ?)) AND ((T175._Fld12065RRef = T173._IDRRef) AND (T175._Fld12066RRef = T174._IDRRef)))) AND T174._IDRRef IN
- (SELECT
- T176._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T176
- INNER JOIN dbo._InfoRg9937 T177
- ON ((T177._Fld9939_TYPE = 0x08 AND T177._Fld9939_RTRef = 0x00000095 AND T177._Fld9939_RRRef = ?) AND (T177._Fld9938_TYPE = T176._Fld784_TYPE AND T177._Fld9938_RTRef = T176._Fld784_RTRef AND T177._Fld9938_RRRef = T176._Fld784_RRRef))
- WHERE ((T176._Fld595 = ?)) AND (T177._Fld595 = ?)))
- WHERE ((T174._Fld595 = ?)) AND ((CASE WHEN T172._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T172._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T178
- WHERE ((T178._Fld595 = ?)) AND ((T178._Fld12072RRef = T174._IDRRef) AND (T178._Fld12073_TYPE = CASE WHEN T172._Fld12836RRef IS NOT NULL THEN 0x08 END AND T178._Fld12073_RTRef = CASE WHEN T172._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T178._Fld12073_RRRef = T172._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T179
- WHERE ((T179._Fld595 = ?)) AND ((T179._Fld12199RRef = T174._IDRRef) AND T179._Fld12200_TYPE = CASE WHEN T172._Fld12836RRef IS NOT NULL THEN 0x08 END AND T179._Fld12200_RTRef = CASE WHEN T172._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T179._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T171._Fld595 = ?)) T170
- ON T85.RecorderTRef = 0x000000D3 AND T85.RecorderRRef = T170.IDRRef
- LEFT OUTER JOIN dbo._Document248 T180
- ON (T85.RecorderTRef = 0x000000F8 AND T85.RecorderRRef = T180._IDRRef) AND (T180._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T182._Fld5855RRef AS Fld5855RRef,
- T182._IDRRef AS IDRRef,
- T182._Fld5860_TYPE AS Fld5860_TYPE,
- T182._Fld5860_RTRef AS Fld5860_RTRef,
- T182._Fld5860_RRRef AS Fld5860_RRRef,
- T182._Fld595 AS Fld595_
- FROM dbo._Document255 T182
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T183
- ON ((T182._Fld5855RRef = T183._IDRRef)) AND (T183._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T184
- INNER JOIN dbo._Reference21 T185
- ON (((T184._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T186
- WHERE ((T186._Fld595 = ?)) AND ((T186._Fld12065RRef = T184._IDRRef) AND (T186._Fld12066RRef = T185._IDRRef)))) AND T185._IDRRef IN
- (SELECT
- T187._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T187
- INNER JOIN dbo._InfoRg9937 T188
- ON ((T188._Fld9939_TYPE = 0x08 AND T188._Fld9939_RTRef = 0x00000095 AND T188._Fld9939_RRRef = ?) AND (T188._Fld9938_TYPE = T187._Fld784_TYPE AND T188._Fld9938_RTRef = T187._Fld784_RTRef AND T188._Fld9938_RRRef = T187._Fld784_RRRef))
- WHERE ((T187._Fld595 = ?)) AND (T188._Fld595 = ?)))
- WHERE ((T185._Fld595 = ?)) AND ((CASE WHEN T183._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T183._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T189
- WHERE ((T189._Fld595 = ?)) AND ((T189._Fld12072RRef = T185._IDRRef) AND (T189._Fld12073_TYPE = CASE WHEN T183._Fld12836RRef IS NOT NULL THEN 0x08 END AND T189._Fld12073_RTRef = CASE WHEN T183._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T189._Fld12073_RRRef = T183._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T190
- WHERE ((T190._Fld595 = ?)) AND ((T190._Fld12199RRef = T185._IDRRef) AND T190._Fld12200_TYPE = CASE WHEN T183._Fld12836RRef IS NOT NULL THEN 0x08 END AND T190._Fld12200_RTRef = CASE WHEN T183._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T190._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T182._Fld595 = ?)) T181
- ON T85.RecorderTRef = 0x000000FF AND T85.RecorderRRef = T181.IDRRef
- LEFT OUTER JOIN dbo._Document210 T191
- ON (T85.RecorderTRef = 0x000000D2 AND T85.RecorderRRef = T191._IDRRef) AND (T191._Fld595 = ?)
- WHERE (NOT (((CASE WHEN T85.RecorderTRef = 0x000000E9 THEN T95.Fld4634_TYPE WHEN T85.RecorderTRef = 0x000000D4 THEN CASE WHEN T105._Fld3521RRef IS NOT NULL THEN 0x08 END WHEN T85.RecorderTRef = 0x000000EA THEN T106.Fld4782_TYPE WHEN T85.RecorderTRef = 0x000000FD THEN T118._Fld5727_TYPE WHEN T85.RecorderTRef = 0x00000103 THEN T119.Fld6145_TYPE WHEN T85.RecorderTRef = 0x000000D8 THEN T129.Fld3852_TYPE WHEN T85.RecorderTRef = 0x000000D1 THEN T139.Fld3325_TYPE WHEN T85.RecorderTRef = 0x000000D7 THEN CASE WHEN T151.Fld3739RRef IS NOT NULL THEN 0x08 END WHEN T85.RecorderTRef = 0x00000102 THEN T161.Fld6057_TYPE WHEN T85.RecorderTRef = 0x000000D3 THEN T170.Fld3444_TYPE WHEN T85.RecorderTRef = 0x000000F8 THEN CASE WHEN T180._Fld5366RRef IS NOT NULL THEN 0x08 END WHEN T85.RecorderTRef = 0x000000FF THEN T181.Fld5860_TYPE WHEN T85.RecorderTRef = 0x000000D2 THEN T191._Fld3350_TYPE ELSE CAST(NULL AS BINARY(1)) END = 0x08 AND CASE WHEN T85.RecorderTRef = 0x000000E9 THEN T95.Fld4634_RTRef WHEN T85.RecorderTRef = 0x000000D4 THEN CASE WHEN T105._Fld3521RRef IS NOT NULL THEN 0x000000E9 END WHEN T85.RecorderTRef = 0x000000EA THEN T106.Fld4782_RTRef WHEN T85.RecorderTRef = 0x000000FD THEN T118._Fld5727_RTRef WHEN T85.RecorderTRef = 0x00000103 THEN T119.Fld6145_RTRef WHEN T85.RecorderTRef = 0x000000D8 THEN T129.Fld3852_RTRef WHEN T85.RecorderTRef = 0x000000D1 THEN T139.Fld3325_RTRef WHEN T85.RecorderTRef = 0x000000D7 THEN CASE WHEN T151.Fld3739RRef IS NOT NULL THEN 0x000000E9 END WHEN T85.RecorderTRef = 0x00000102 THEN T161.Fld6057_RTRef WHEN T85.RecorderTRef = 0x000000D3 THEN T170.Fld3444_RTRef WHEN T85.RecorderTRef = 0x000000F8 THEN CASE WHEN T180._Fld5366RRef IS NOT NULL THEN 0x000000F9 END WHEN T85.RecorderTRef = 0x000000FF THEN T181.Fld5860_RTRef WHEN T85.RecorderTRef = 0x000000D2 THEN T191._Fld3350_RTRef ELSE CAST(NULL AS BINARY(4)) END = 0x000000D3)))) AND ((T85.RecorderTRef = 0x00000103) OR (T85.RecorderTRef = 0x000000FF))
- UNION ALL SELECT
- T192.Fld10332_TYPE,
- T192.Fld10332_RTRef,
- T192.Fld10332_RRRef,
- T192.Fld10328RRef,
- CAST(NULL AS NUMERIC(28, 2)),
- T192.Fld10330RRef,
- CAST(NULL AS NUMERIC(28, 2)),
- CAST(NULL AS NUMERIC(28, 2)),
- CAST(NULL AS NUMERIC(21, 2)),
- T192.Fld10334Receipt_
- FROM (SELECT
- T193._RecorderTRef AS RecorderTRef,
- T193._RecorderRRef AS RecorderRRef,
- T193._Fld10332_TYPE AS Fld10332_TYPE,
- T193._Fld10332_RTRef AS Fld10332_RTRef,
- T193._Fld10332_RRRef AS Fld10332_RRRef,
- T193._Fld10328RRef AS Fld10328RRef,
- T193._Fld10330RRef AS Fld10330RRef,
- CAST(SUM(CASE WHEN T193._RecordKind = 0.0 THEN T193._Fld10334 ELSE 0.0 END) AS NUMERIC(27, 8)) AS Fld10334Receipt_
- FROM dbo._AccumRg10327 T193
- WHERE (((T193._Fld595 = ?)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T194
- ON ((T193._Fld10330RRef = T194._IDRRef)) AND (T194._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T195
- INNER JOIN dbo._Reference21 T196
- ON (((T195._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T197
- WHERE ((T197._Fld595 = ?)) AND ((T197._Fld12065RRef = T195._IDRRef) AND (T197._Fld12066RRef = T196._IDRRef)))) AND T196._IDRRef IN
- (SELECT
- T198._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T198
- INNER JOIN dbo._InfoRg9937 T199
- ON ((T199._Fld9939_TYPE = 0x08 AND T199._Fld9939_RTRef = 0x00000095 AND T199._Fld9939_RRRef = ?) AND (T199._Fld9938_TYPE = T198._Fld784_TYPE AND T199._Fld9938_RTRef = T198._Fld784_RTRef AND T199._Fld9938_RRRef = T198._Fld784_RRRef))
- WHERE ((T198._Fld595 = ?)) AND (T199._Fld595 = ?)))
- WHERE ((T196._Fld595 = ?)) AND ((CASE WHEN T194._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T194._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T200
- WHERE ((T200._Fld595 = ?)) AND ((T200._Fld12072RRef = T196._IDRRef) AND (T200._Fld12073_TYPE = CASE WHEN T194._Fld12836RRef IS NOT NULL THEN 0x08 END AND T200._Fld12073_RTRef = CASE WHEN T194._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T200._Fld12073_RRRef = T194._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T201
- WHERE ((T201._Fld595 = ?)) AND ((T201._Fld12199RRef = T196._IDRRef) AND T201._Fld12200_TYPE = CASE WHEN T194._Fld12836RRef IS NOT NULL THEN 0x08 END AND T201._Fld12200_RTRef = CASE WHEN T194._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T201._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T193._Period >= ? AND T193._Period <= ? AND T193._Active = 0x01 AND T193._RecordKind = ?)
- GROUP BY T193._RecorderTRef,
- T193._RecorderRRef,
- T193._Fld10332_TYPE,
- T193._Fld10332_RTRef,
- T193._Fld10332_RRRef,
- T193._Fld10328RRef,
- T193._Fld10330RRef
- HAVING (CAST(SUM(CASE WHEN T193._RecordKind = 0.0 THEN T193._Fld10334 ELSE 0.0 END) AS NUMERIC(27, 8))) <> 0.0) T192
- WHERE (T192.RecorderTRef = 0x000000D1)
- ",Context='Form.Call : Report.SalesExecutivesInfoFromInvoices.Form.Module.GenerateDirectly
- CommonForm.ReportForm.Form : 4405 : ComposeResult(ResultCompositionMode.Auto);
- ShajiAutoPaints_BIT Report.SalesExecutivesInfoFromInvoices.ObjectModule : 26 : ResultItem = CompositionProcessor.Next();'
- 19781089=Duration,7=Execs,Sql="SELECT
- CAST(SUM(T1._Q_000_F_002) AS NUMERIC(38, 8)),
- CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END,
- T1._Q_000_F_003RRef,
- CAST(SUM(T1._Q_000_F_004) AS NUMERIC(38, 8)),
- CAST(SUM(T1._Q_000_F_005) AS NUMERIC(38, 8)),
- CAST(SUM(T1._Q_000_F_006) AS NUMERIC(33, 8)),
- CAST(NULL AS NUMERIC(38, 8)),
- CAST(SUM(CASE WHEN (CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E4 THEN T12._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D4 THEN T13._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000EA THEN T14.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000FD THEN T26._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000114 THEN T27._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000107 THEN T28._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C8 THEN T29._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000103 THEN T30.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D8 THEN T40.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D7 THEN T50.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000116 THEN T60._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D5 THEN T61._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D3 THEN T62.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000F8 THEN T72._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000FF THEN T73.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C7 THEN T83._Date_Time ELSE CAST(NULL AS DATETIME) END < {ts '4018-01-01 00:00:00'}) THEN T1._Q_000_F_006 ELSE 0.0 END) AS NUMERIC(33, 8)),
- CAST(SUM(CASE WHEN ((CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E4 THEN T12._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D4 THEN T13._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000EA THEN T14.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000FD THEN T26._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000114 THEN T27._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000107 THEN T28._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C8 THEN T29._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000103 THEN T30.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D8 THEN T40.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D7 THEN T50.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000116 THEN T60._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D5 THEN T61._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D3 THEN T62.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000F8 THEN T72._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000FF THEN T73.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C7 THEN T83._Date_Time ELSE CAST(NULL AS DATETIME) END >= {ts '4018-01-01 00:00:00'}) OR CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E4 THEN T12._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D4 THEN T13._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000EA THEN T14.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000FD THEN T26._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000114 THEN T27._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000107 THEN T28._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C8 THEN T29._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000103 THEN T30.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D8 THEN T40.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D7 THEN T50.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000116 THEN T60._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D5 THEN T61._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D3 THEN T62.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000F8 THEN T72._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000FF THEN T73.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C7 THEN T83._Date_Time ELSE CAST(NULL AS DATETIME) END IS NULL) THEN T1._Q_000_F_006 ELSE 0.0 END) AS NUMERIC(33, 8)),
- T1._Q_000_F_007,
- CAST(SUM(CASE WHEN (CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E4 THEN T12._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D4 THEN T13._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000EA THEN T14.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000FD THEN T26._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000114 THEN T27._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000107 THEN T28._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C8 THEN T29._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000103 THEN T30.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D8 THEN T40.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D7 THEN T50.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000116 THEN T60._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D5 THEN T61._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D3 THEN T62.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000F8 THEN T72._Date_Time WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000FF THEN T73.Date_Time_ WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C7 THEN T83._Date_Time ELSE CAST(NULL AS DATETIME) END < {ts '4018-01-01 00:00:00'}) THEN T1._Q_000_F_006 ELSE (CAST(T1._Q_000_F_006 AS NUMERIC(27, 8)) / 1.05) END) AS NUMERIC(35, 8)),
- T1._Q_000_F_003RRef,
- T84.Description_,
- 3.0,
- T84.Description_,
- CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END,
- T93._Description,
- 4.0,
- CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T94._Description ELSE CAST(NULL AS NVARCHAR(100)) END
- FROM #tt T1 WITH(NOLOCK)
- LEFT OUTER JOIN (SELECT
- T3._IDRRef AS IDRRef,
- T3._Date_Time AS Date_Time_,
- T3._Fld12737RRef AS Fld12737RRef,
- T3._Fld4654RRef AS Fld4654RRef,
- T3._Fld4625RRef AS Fld4625RRef,
- T3._Fld595 AS Fld595_
- FROM dbo._Document233 T3
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T4
- ON ((T3._Fld4625RRef = T4._IDRRef)) AND (T4._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T5
- INNER JOIN dbo._Reference21 T6
- ON (((T5._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T7
- WHERE ((T7._Fld595 = ?)) AND ((T7._Fld12065RRef = T5._IDRRef) AND (T7._Fld12066RRef = T6._IDRRef)))) AND T6._IDRRef IN
- (SELECT
- T8._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T8
- INNER JOIN dbo._InfoRg9937 T9
- ON ((T9._Fld9939_TYPE = 0x08 AND T9._Fld9939_RTRef = 0x00000095 AND T9._Fld9939_RRRef = ?) AND (T9._Fld9938_TYPE = T8._Fld784_TYPE AND T9._Fld9938_RTRef = T8._Fld784_RTRef AND T9._Fld9938_RRRef = T8._Fld784_RRRef))
- WHERE ((T8._Fld595 = ?)) AND (T9._Fld595 = ?)))
- WHERE ((T6._Fld595 = ?)) AND ((CASE WHEN T4._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T4._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T10
- WHERE ((T10._Fld595 = ?)) AND ((T10._Fld12072RRef = T6._IDRRef) AND (T10._Fld12073_TYPE = CASE WHEN T4._Fld12836RRef IS NOT NULL THEN 0x08 END AND T10._Fld12073_RTRef = CASE WHEN T4._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T10._Fld12073_RRRef = T4._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T11
- WHERE ((T11._Fld595 = ?)) AND ((T11._Fld12199RRef = T6._IDRRef) AND T11._Fld12200_TYPE = CASE WHEN T4._Fld12836RRef IS NOT NULL THEN 0x08 END AND T11._Fld12200_RTRef = CASE WHEN T4._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T11._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T3._Fld595 = ?)) T2
- ON T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 AND T1._Q_000_F_000_RRRef = T2.IDRRef
- LEFT OUTER JOIN dbo._Document228 T12
- ON (T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E4 AND T1._Q_000_F_000_RRRef = T12._IDRRef) AND (T12._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document212 T13
- ON (T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D4 AND T1._Q_000_F_000_RRRef = T13._IDRRef) AND (T13._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T15._Date_Time AS Date_Time_,
- T15._IDRRef AS IDRRef,
- T15._Fld4779RRef AS Fld4779RRef,
- T15._Fld595 AS Fld595_,
- T15._Fld4798RRef AS Fld4798RRef,
- T15._Fld4774RRef AS Fld4774RRef
- FROM dbo._Document234 T15
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T16
- ON ((T15._Fld4774RRef = T16._IDRRef)) AND (T16._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T17
- INNER JOIN dbo._Reference21 T18
- ON (((T17._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T19
- WHERE ((T19._Fld595 = ?)) AND ((T19._Fld12065RRef = T17._IDRRef) AND (T19._Fld12066RRef = T18._IDRRef)))) AND T18._IDRRef IN
- (SELECT
- T20._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T20
- INNER JOIN dbo._InfoRg9937 T21
- ON ((T21._Fld9939_TYPE = 0x08 AND T21._Fld9939_RTRef = 0x00000095 AND T21._Fld9939_RRRef = ?) AND (T21._Fld9938_TYPE = T20._Fld784_TYPE AND T21._Fld9938_RTRef = T20._Fld784_RTRef AND T21._Fld9938_RRRef = T20._Fld784_RRRef))
- WHERE ((T20._Fld595 = ?)) AND (T21._Fld595 = ?)))
- WHERE ((T18._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T22
- WHERE ((T22._Fld595 = ?)) AND ((T22._Fld12072RRef = T18._IDRRef) AND (T22._Fld12073_TYPE = 0x08 AND T22._Fld12073_RTRef = 0x0000001C AND T22._Fld12073_RRRef = T15._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T23
- WHERE ((T23._Fld595 = ?)) AND ((T23._Fld12199RRef = T18._IDRRef) AND T23._Fld12200_TYPE = 0x08 AND T23._Fld12200_RTRef = 0x0000001C AND (T23._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T16._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T16._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T24
- WHERE ((T24._Fld595 = ?)) AND ((T24._Fld12072RRef = T18._IDRRef) AND (T24._Fld12073_TYPE = CASE WHEN T16._Fld12836RRef IS NOT NULL THEN 0x08 END AND T24._Fld12073_RTRef = CASE WHEN T16._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T24._Fld12073_RRRef = T16._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T25
- WHERE ((T25._Fld595 = ?)) AND ((T25._Fld12199RRef = T18._IDRRef) AND T25._Fld12200_TYPE = CASE WHEN T16._Fld12836RRef IS NOT NULL THEN 0x08 END AND T25._Fld12200_RTRef = CASE WHEN T16._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T25._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T15._Fld595 = ?)) T14
- ON T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000EA AND T1._Q_000_F_000_RRRef = T14.IDRRef
- LEFT OUTER JOIN dbo._Document253 T26
- ON (T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000FD AND T1._Q_000_F_000_RRRef = T26._IDRRef) AND (T26._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document276 T27
- ON (T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000114 AND T1._Q_000_F_000_RRRef = T27._IDRRef) AND (T27._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document263 T28
- ON (T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000107 AND T1._Q_000_F_000_RRRef = T28._IDRRef) AND (T28._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document200 T29
- ON (T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C8 AND T1._Q_000_F_000_RRRef = T29._IDRRef) AND (T29._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T31._IDRRef AS IDRRef,
- T31._Date_Time AS Date_Time_,
- T31._Fld595 AS Fld595_,
- T31._Fld6139RRef AS Fld6139RRef
- FROM dbo._Document259 T31
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T32
- ON ((T31._Fld6139RRef = T32._IDRRef)) AND (T32._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T33
- INNER JOIN dbo._Reference21 T34
- ON (((T33._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T35
- WHERE ((T35._Fld595 = ?)) AND ((T35._Fld12065RRef = T33._IDRRef) AND (T35._Fld12066RRef = T34._IDRRef)))) AND T34._IDRRef IN
- (SELECT
- T36._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T36
- INNER JOIN dbo._InfoRg9937 T37
- ON ((T37._Fld9939_TYPE = 0x08 AND T37._Fld9939_RTRef = 0x00000095 AND T37._Fld9939_RRRef = ?) AND (T37._Fld9938_TYPE = T36._Fld784_TYPE AND T37._Fld9938_RTRef = T36._Fld784_RTRef AND T37._Fld9938_RRRef = T36._Fld784_RRRef))
- WHERE ((T36._Fld595 = ?)) AND (T37._Fld595 = ?)))
- WHERE ((T34._Fld595 = ?)) AND ((CASE WHEN T32._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T38
- WHERE ((T38._Fld595 = ?)) AND ((T38._Fld12072RRef = T34._IDRRef) AND (T38._Fld12073_TYPE = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END AND T38._Fld12073_RTRef = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T38._Fld12073_RRRef = T32._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T39
- WHERE ((T39._Fld595 = ?)) AND ((T39._Fld12199RRef = T34._IDRRef) AND T39._Fld12200_TYPE = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END AND T39._Fld12200_RTRef = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T39._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T31._Fld595 = ?)) T30
- ON T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000103 AND T1._Q_000_F_000_RRRef = T30.IDRRef
- LEFT OUTER JOIN (SELECT
- T41._IDRRef AS IDRRef,
- T41._Fld3845RRef AS Fld3845RRef,
- T41._Date_Time AS Date_Time_,
- T41._Fld3877RRef AS Fld3877RRef,
- T41._Fld595 AS Fld595_
- FROM dbo._Document216 T41
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T42
- ON ((T41._Fld3845RRef = T42._IDRRef)) AND (T42._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T43
- INNER JOIN dbo._Reference21 T44
- ON (((T43._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T45
- WHERE ((T45._Fld595 = ?)) AND ((T45._Fld12065RRef = T43._IDRRef) AND (T45._Fld12066RRef = T44._IDRRef)))) AND T44._IDRRef IN
- (SELECT
- T46._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T46
- INNER JOIN dbo._InfoRg9937 T47
- ON ((T47._Fld9939_TYPE = 0x08 AND T47._Fld9939_RTRef = 0x00000095 AND T47._Fld9939_RRRef = ?) AND (T47._Fld9938_TYPE = T46._Fld784_TYPE AND T47._Fld9938_RTRef = T46._Fld784_RTRef AND T47._Fld9938_RRRef = T46._Fld784_RRRef))
- WHERE ((T46._Fld595 = ?)) AND (T47._Fld595 = ?)))
- WHERE ((T44._Fld595 = ?)) AND ((CASE WHEN T42._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T42._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T48
- WHERE ((T48._Fld595 = ?)) AND ((T48._Fld12072RRef = T44._IDRRef) AND (T48._Fld12073_TYPE = CASE WHEN T42._Fld12836RRef IS NOT NULL THEN 0x08 END AND T48._Fld12073_RTRef = CASE WHEN T42._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T48._Fld12073_RRRef = T42._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T49
- WHERE ((T49._Fld595 = ?)) AND ((T49._Fld12199RRef = T44._IDRRef) AND T49._Fld12200_TYPE = CASE WHEN T42._Fld12836RRef IS NOT NULL THEN 0x08 END AND T49._Fld12200_RTRef = CASE WHEN T42._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T49._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T41._Fld595 = ?)) T40
- ON T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D8 AND T1._Q_000_F_000_RRRef = T40.IDRRef
- LEFT OUTER JOIN (SELECT
- T51._Fld595 AS Fld595_,
- T51._Fld3752RRef AS Fld3752RRef,
- T51._IDRRef AS IDRRef,
- T51._Fld3734RRef AS Fld3734RRef,
- T51._Date_Time AS Date_Time_
- FROM dbo._Document215 T51
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T52
- ON ((T51._Fld3734RRef = T52._IDRRef)) AND (T52._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T53
- INNER JOIN dbo._Reference21 T54
- ON (((T53._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T55
- WHERE ((T55._Fld595 = ?)) AND ((T55._Fld12065RRef = T53._IDRRef) AND (T55._Fld12066RRef = T54._IDRRef)))) AND T54._IDRRef IN
- (SELECT
- T56._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T56
- INNER JOIN dbo._InfoRg9937 T57
- ON ((T57._Fld9939_TYPE = 0x08 AND T57._Fld9939_RTRef = 0x00000095 AND T57._Fld9939_RRRef = ?) AND (T57._Fld9938_TYPE = T56._Fld784_TYPE AND T57._Fld9938_RTRef = T56._Fld784_RTRef AND T57._Fld9938_RRRef = T56._Fld784_RRRef))
- WHERE ((T56._Fld595 = ?)) AND (T57._Fld595 = ?)))
- WHERE ((T54._Fld595 = ?)) AND ((CASE WHEN T52._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T52._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T58
- WHERE ((T58._Fld595 = ?)) AND ((T58._Fld12072RRef = T54._IDRRef) AND (T58._Fld12073_TYPE = CASE WHEN T52._Fld12836RRef IS NOT NULL THEN 0x08 END AND T58._Fld12073_RTRef = CASE WHEN T52._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T58._Fld12073_RRRef = T52._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T59
- WHERE ((T59._Fld595 = ?)) AND ((T59._Fld12199RRef = T54._IDRRef) AND T59._Fld12200_TYPE = CASE WHEN T52._Fld12836RRef IS NOT NULL THEN 0x08 END AND T59._Fld12200_RTRef = CASE WHEN T52._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T59._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T51._Fld595 = ?)) T50
- ON T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D7 AND T1._Q_000_F_000_RRRef = T50.IDRRef
- LEFT OUTER JOIN dbo._Document278 T60
- ON (T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000116 AND T1._Q_000_F_000_RRRef = T60._IDRRef) AND (T60._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document213 T61
- ON (T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D5 AND T1._Q_000_F_000_RRRef = T61._IDRRef) AND (T61._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T63._Date_Time AS Date_Time_,
- T63._IDRRef AS IDRRef,
- T63._Fld3438RRef AS Fld3438RRef,
- T63._Fld595 AS Fld595_
- FROM dbo._Document211 T63
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T64
- ON ((T63._Fld3438RRef = T64._IDRRef)) AND (T64._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T65
- INNER JOIN dbo._Reference21 T66
- ON (((T65._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T67
- WHERE ((T67._Fld595 = ?)) AND ((T67._Fld12065RRef = T65._IDRRef) AND (T67._Fld12066RRef = T66._IDRRef)))) AND T66._IDRRef IN
- (SELECT
- T68._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T68
- INNER JOIN dbo._InfoRg9937 T69
- ON ((T69._Fld9939_TYPE = 0x08 AND T69._Fld9939_RTRef = 0x00000095 AND T69._Fld9939_RRRef = ?) AND (T69._Fld9938_TYPE = T68._Fld784_TYPE AND T69._Fld9938_RTRef = T68._Fld784_RTRef AND T69._Fld9938_RRRef = T68._Fld784_RRRef))
- WHERE ((T68._Fld595 = ?)) AND (T69._Fld595 = ?)))
- WHERE ((T66._Fld595 = ?)) AND ((CASE WHEN T64._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T64._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T70
- WHERE ((T70._Fld595 = ?)) AND ((T70._Fld12072RRef = T66._IDRRef) AND (T70._Fld12073_TYPE = CASE WHEN T64._Fld12836RRef IS NOT NULL THEN 0x08 END AND T70._Fld12073_RTRef = CASE WHEN T64._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T70._Fld12073_RRRef = T64._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T71
- WHERE ((T71._Fld595 = ?)) AND ((T71._Fld12199RRef = T66._IDRRef) AND T71._Fld12200_TYPE = CASE WHEN T64._Fld12836RRef IS NOT NULL THEN 0x08 END AND T71._Fld12200_RTRef = CASE WHEN T64._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T71._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T63._Fld595 = ?)) T62
- ON T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D3 AND T1._Q_000_F_000_RRRef = T62.IDRRef
- LEFT OUTER JOIN dbo._Document248 T72
- ON (T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000F8 AND T1._Q_000_F_000_RRRef = T72._IDRRef) AND (T72._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T74._Fld5855RRef AS Fld5855RRef,
- T74._IDRRef AS IDRRef,
- T74._Date_Time AS Date_Time_,
- T74._Fld595 AS Fld595_
- FROM dbo._Document255 T74
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T75
- ON ((T74._Fld5855RRef = T75._IDRRef)) AND (T75._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T76
- INNER JOIN dbo._Reference21 T77
- ON (((T76._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T78
- WHERE ((T78._Fld595 = ?)) AND ((T78._Fld12065RRef = T76._IDRRef) AND (T78._Fld12066RRef = T77._IDRRef)))) AND T77._IDRRef IN
- (SELECT
- T79._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T79
- INNER JOIN dbo._InfoRg9937 T80
- ON ((T80._Fld9939_TYPE = 0x08 AND T80._Fld9939_RTRef = 0x00000095 AND T80._Fld9939_RRRef = ?) AND (T80._Fld9938_TYPE = T79._Fld784_TYPE AND T80._Fld9938_RTRef = T79._Fld784_RTRef AND T80._Fld9938_RRRef = T79._Fld784_RRRef))
- WHERE ((T79._Fld595 = ?)) AND (T80._Fld595 = ?)))
- WHERE ((T77._Fld595 = ?)) AND ((CASE WHEN T75._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T75._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T81
- WHERE ((T81._Fld595 = ?)) AND ((T81._Fld12072RRef = T77._IDRRef) AND (T81._Fld12073_TYPE = CASE WHEN T75._Fld12836RRef IS NOT NULL THEN 0x08 END AND T81._Fld12073_RTRef = CASE WHEN T75._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T81._Fld12073_RRRef = T75._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T82
- WHERE ((T82._Fld595 = ?)) AND ((T82._Fld12199RRef = T77._IDRRef) AND T82._Fld12200_TYPE = CASE WHEN T75._Fld12836RRef IS NOT NULL THEN 0x08 END AND T82._Fld12200_RTRef = CASE WHEN T75._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T82._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T74._Fld595 = ?)) T73
- ON T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000FF AND T1._Q_000_F_000_RRRef = T73.IDRRef
- LEFT OUTER JOIN dbo._Document199 T83
- ON (T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C7 AND T1._Q_000_F_000_RRRef = T83._IDRRef) AND (T83._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T85._IDRRef AS IDRRef,
- T85._Fld12836RRef AS Fld12836RRef,
- T85._Fld595 AS Fld595_,
- T85._Folder AS Folder_,
- T85._Description COLLATE Latin1_General_CI_AS AS Description_
- FROM dbo._Reference42 T85
- WHERE ((((T85._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T86
- INNER JOIN dbo._Reference21 T87
- ON (((T86._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T88
- WHERE ((T88._Fld595 = ?)) AND ((T88._Fld12065RRef = T86._IDRRef) AND (T88._Fld12066RRef = T87._IDRRef)))) AND T87._IDRRef IN
- (SELECT
- T89._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T89
- INNER JOIN dbo._InfoRg9937 T90
- ON ((T90._Fld9939_TYPE = 0x08 AND T90._Fld9939_RTRef = 0x00000095 AND T90._Fld9939_RRRef = ?) AND (T90._Fld9938_TYPE = T89._Fld784_TYPE AND T90._Fld9938_RTRef = T89._Fld784_RTRef AND T90._Fld9938_RRRef = T89._Fld784_RRRef))
- WHERE ((T89._Fld595 = ?)) AND (T90._Fld595 = ?)))
- WHERE ((T87._Fld595 = ?)) AND ((CASE WHEN T85._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T85._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T91
- WHERE ((T91._Fld595 = ?)) AND ((T91._Fld12072RRef = T87._IDRRef) AND (T91._Fld12073_TYPE = CASE WHEN T85._Fld12836RRef IS NOT NULL THEN 0x08 END AND T91._Fld12073_RTRef = CASE WHEN T85._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T91._Fld12073_RRRef = T85._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T92
- WHERE ((T92._Fld595 = ?)) AND ((T92._Fld12199RRef = T87._IDRRef) AND T92._Fld12200_TYPE = CASE WHEN T85._Fld12836RRef IS NOT NULL THEN 0x08 END AND T92._Fld12200_RTRef = CASE WHEN T85._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T92._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T85._Fld595 = ?)) T84
- ON T1._Q_000_F_003RRef = T84.IDRRef
- LEFT OUTER JOIN dbo._Reference64 T93
- ON (CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END = T93._IDRRef) AND (T93._Fld595 = ?)
- LEFT OUTER JOIN dbo._Reference64 T94
- ON (T2.Fld12737RRef = T94._IDRRef) AND (T94._Fld595 = ?)
- WHERE CASE WHEN (? = ?) THEN CASE WHEN ((CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Fld4654RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D4 THEN T13._Fld3528RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000EA THEN T14.Fld4798RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000114 THEN T27._Fld6926RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000107 THEN T28._Fld6301RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D8 THEN T40.Fld3877RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D7 THEN T50.Fld3752RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000116 THEN T60._Fld7015RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D5 THEN T61._Fld3616RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C7 THEN T83._Fld2852RRef ELSE CAST(NULL AS BINARY(16)) END = ?) OR (CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END = ?)) THEN 0x01 WHEN NOT ((CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Fld4654RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D4 THEN T13._Fld3528RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000EA THEN T14.Fld4798RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000114 THEN T27._Fld6926RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000107 THEN T28._Fld6301RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D8 THEN T40.Fld3877RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D7 THEN T50.Fld3752RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x00000116 THEN T60._Fld7015RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000D5 THEN T61._Fld3616RRef WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000C7 THEN T83._Fld2852RRef ELSE CAST(NULL AS BINARY(16)) END = ?) OR (CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END = ?)) THEN 0x00 END END = 0x01
- GROUP BY T1._Q_000_F_003RRef,
- T1._Q_000_F_007,
- CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END,
- CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T94._Description ELSE CAST(NULL AS NVARCHAR(100)) END,
- T1._Q_000_F_003RRef,
- T84.Description_,
- T84.Description_,
- CASE WHEN T1._Q_000_F_000_TYPE = 0x08 AND T1._Q_000_F_000_RTRef = 0x000000E9 THEN T2.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END,
- T93._Description
- UNION ALL SELECT
- CAST(NULL AS NUMERIC(34, 2)),
- CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T96.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END,
- T95._Q_001_F_000RRef,
- CAST(NULL AS NUMERIC(34, 2)),
- CAST(NULL AS NUMERIC(34, 2)),
- CAST(NULL AS NUMERIC(27, 2)),
- CAST(SUM(T95._Q_001_F_001) AS NUMERIC(38, 8)),
- CAST(NULL AS NUMERIC(27, 2)),
- CAST(NULL AS NUMERIC(27, 2)),
- CAST(NULL AS NUMERIC(21, 2)),
- CAST(NULL AS NUMERIC(35, 8)),
- T95._Q_001_F_000RRef,
- T106.Description_,
- 2.0,
- T106.Description_,
- CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T96.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END,
- T115._Description,
- 5.0,
- CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T116._Description ELSE CAST(NULL AS NVARCHAR(100)) END
- FROM #tt T95 WITH(NOLOCK)
- LEFT OUTER JOIN (SELECT
- T97._IDRRef AS IDRRef,
- T97._Fld12737RRef AS Fld12737RRef,
- T97._Fld4654RRef AS Fld4654RRef,
- T97._Fld4625RRef AS Fld4625RRef,
- T97._Fld595 AS Fld595_
- FROM dbo._Document233 T97
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T98
- ON ((T97._Fld4625RRef = T98._IDRRef)) AND (T98._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T99
- INNER JOIN dbo._Reference21 T100
- ON (((T99._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T101
- WHERE ((T101._Fld595 = ?)) AND ((T101._Fld12065RRef = T99._IDRRef) AND (T101._Fld12066RRef = T100._IDRRef)))) AND T100._IDRRef IN
- (SELECT
- T102._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T102
- INNER JOIN dbo._InfoRg9937 T103
- ON ((T103._Fld9939_TYPE = 0x08 AND T103._Fld9939_RTRef = 0x00000095 AND T103._Fld9939_RRRef = ?) AND (T103._Fld9938_TYPE = T102._Fld784_TYPE AND T103._Fld9938_RTRef = T102._Fld784_RTRef AND T103._Fld9938_RRRef = T102._Fld784_RRRef))
- WHERE ((T102._Fld595 = ?)) AND (T103._Fld595 = ?)))
- WHERE ((T100._Fld595 = ?)) AND ((CASE WHEN T98._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T98._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T104
- WHERE ((T104._Fld595 = ?)) AND ((T104._Fld12072RRef = T100._IDRRef) AND (T104._Fld12073_TYPE = CASE WHEN T98._Fld12836RRef IS NOT NULL THEN 0x08 END AND T104._Fld12073_RTRef = CASE WHEN T98._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T104._Fld12073_RRRef = T98._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T105
- WHERE ((T105._Fld595 = ?)) AND ((T105._Fld12199RRef = T100._IDRRef) AND T105._Fld12200_TYPE = CASE WHEN T98._Fld12836RRef IS NOT NULL THEN 0x08 END AND T105._Fld12200_RTRef = CASE WHEN T98._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T105._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T97._Fld595 = ?)) T96
- ON T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 AND T95._Q_001_F_002_RRRef = T96.IDRRef
- LEFT OUTER JOIN (SELECT
- T107._IDRRef AS IDRRef,
- T107._Fld12836RRef AS Fld12836RRef,
- T107._Fld595 AS Fld595_,
- T107._Folder AS Folder_,
- T107._Description COLLATE Latin1_General_CI_AS AS Description_
- FROM dbo._Reference42 T107
- WHERE ((((T107._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T108
- INNER JOIN dbo._Reference21 T109
- ON (((T108._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T110
- WHERE ((T110._Fld595 = ?)) AND ((T110._Fld12065RRef = T108._IDRRef) AND (T110._Fld12066RRef = T109._IDRRef)))) AND T109._IDRRef IN
- (SELECT
- T111._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T111
- INNER JOIN dbo._InfoRg9937 T112
- ON ((T112._Fld9939_TYPE = 0x08 AND T112._Fld9939_RTRef = 0x00000095 AND T112._Fld9939_RRRef = ?) AND (T112._Fld9938_TYPE = T111._Fld784_TYPE AND T112._Fld9938_RTRef = T111._Fld784_RTRef AND T112._Fld9938_RRRef = T111._Fld784_RRRef))
- WHERE ((T111._Fld595 = ?)) AND (T112._Fld595 = ?)))
- WHERE ((T109._Fld595 = ?)) AND ((CASE WHEN T107._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T107._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T113
- WHERE ((T113._Fld595 = ?)) AND ((T113._Fld12072RRef = T109._IDRRef) AND (T113._Fld12073_TYPE = CASE WHEN T107._Fld12836RRef IS NOT NULL THEN 0x08 END AND T113._Fld12073_RTRef = CASE WHEN T107._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T113._Fld12073_RRRef = T107._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T114
- WHERE ((T114._Fld595 = ?)) AND ((T114._Fld12199RRef = T109._IDRRef) AND T114._Fld12200_TYPE = CASE WHEN T107._Fld12836RRef IS NOT NULL THEN 0x08 END AND T114._Fld12200_RTRef = CASE WHEN T107._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T114._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T107._Fld595 = ?)) T106
- ON T95._Q_001_F_000RRef = T106.IDRRef
- LEFT OUTER JOIN dbo._Reference64 T115
- ON (CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T96.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END = T115._IDRRef) AND (T115._Fld595 = ?)
- LEFT OUTER JOIN dbo._Reference64 T116
- ON (T96.Fld12737RRef = T116._IDRRef) AND (T116._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document212 T117
- ON (T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000D4 AND T95._Q_001_F_002_RRRef = T117._IDRRef) AND (T117._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T119._IDRRef AS IDRRef,
- T119._Fld4779RRef AS Fld4779RRef,
- T119._Fld595 AS Fld595_,
- T119._Fld4798RRef AS Fld4798RRef,
- T119._Fld4774RRef AS Fld4774RRef
- FROM dbo._Document234 T119
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T120
- ON ((T119._Fld4774RRef = T120._IDRRef)) AND (T120._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T121
- INNER JOIN dbo._Reference21 T122
- ON (((T121._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T123
- WHERE ((T123._Fld595 = ?)) AND ((T123._Fld12065RRef = T121._IDRRef) AND (T123._Fld12066RRef = T122._IDRRef)))) AND T122._IDRRef IN
- (SELECT
- T124._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T124
- INNER JOIN dbo._InfoRg9937 T125
- ON ((T125._Fld9939_TYPE = 0x08 AND T125._Fld9939_RTRef = 0x00000095 AND T125._Fld9939_RRRef = ?) AND (T125._Fld9938_TYPE = T124._Fld784_TYPE AND T125._Fld9938_RTRef = T124._Fld784_RTRef AND T125._Fld9938_RRRef = T124._Fld784_RRRef))
- WHERE ((T124._Fld595 = ?)) AND (T125._Fld595 = ?)))
- WHERE ((T122._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T126
- WHERE ((T126._Fld595 = ?)) AND ((T126._Fld12072RRef = T122._IDRRef) AND (T126._Fld12073_TYPE = 0x08 AND T126._Fld12073_RTRef = 0x0000001C AND T126._Fld12073_RRRef = T119._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T127
- WHERE ((T127._Fld595 = ?)) AND ((T127._Fld12199RRef = T122._IDRRef) AND T127._Fld12200_TYPE = 0x08 AND T127._Fld12200_RTRef = 0x0000001C AND (T127._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T120._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T120._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T128
- WHERE ((T128._Fld595 = ?)) AND ((T128._Fld12072RRef = T122._IDRRef) AND (T128._Fld12073_TYPE = CASE WHEN T120._Fld12836RRef IS NOT NULL THEN 0x08 END AND T128._Fld12073_RTRef = CASE WHEN T120._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T128._Fld12073_RRRef = T120._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T129
- WHERE ((T129._Fld595 = ?)) AND ((T129._Fld12199RRef = T122._IDRRef) AND T129._Fld12200_TYPE = CASE WHEN T120._Fld12836RRef IS NOT NULL THEN 0x08 END AND T129._Fld12200_RTRef = CASE WHEN T120._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T129._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T119._Fld595 = ?)) T118
- ON T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000EA AND T95._Q_001_F_002_RRRef = T118.IDRRef
- LEFT OUTER JOIN dbo._Document263 T130
- ON (T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x00000107 AND T95._Q_001_F_002_RRRef = T130._IDRRef) AND (T130._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T132._IDRRef AS IDRRef,
- T132._Fld3845RRef AS Fld3845RRef,
- T132._Fld3877RRef AS Fld3877RRef,
- T132._Fld595 AS Fld595_
- FROM dbo._Document216 T132
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T133
- ON ((T132._Fld3845RRef = T133._IDRRef)) AND (T133._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T134
- INNER JOIN dbo._Reference21 T135
- ON (((T134._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T136
- WHERE ((T136._Fld595 = ?)) AND ((T136._Fld12065RRef = T134._IDRRef) AND (T136._Fld12066RRef = T135._IDRRef)))) AND T135._IDRRef IN
- (SELECT
- T137._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T137
- INNER JOIN dbo._InfoRg9937 T138
- ON ((T138._Fld9939_TYPE = 0x08 AND T138._Fld9939_RTRef = 0x00000095 AND T138._Fld9939_RRRef = ?) AND (T138._Fld9938_TYPE = T137._Fld784_TYPE AND T138._Fld9938_RTRef = T137._Fld784_RTRef AND T138._Fld9938_RRRef = T137._Fld784_RRRef))
- WHERE ((T137._Fld595 = ?)) AND (T138._Fld595 = ?)))
- WHERE ((T135._Fld595 = ?)) AND ((CASE WHEN T133._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T133._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T139
- WHERE ((T139._Fld595 = ?)) AND ((T139._Fld12072RRef = T135._IDRRef) AND (T139._Fld12073_TYPE = CASE WHEN T133._Fld12836RRef IS NOT NULL THEN 0x08 END AND T139._Fld12073_RTRef = CASE WHEN T133._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T139._Fld12073_RRRef = T133._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T140
- WHERE ((T140._Fld595 = ?)) AND ((T140._Fld12199RRef = T135._IDRRef) AND T140._Fld12200_TYPE = CASE WHEN T133._Fld12836RRef IS NOT NULL THEN 0x08 END AND T140._Fld12200_RTRef = CASE WHEN T133._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T140._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T132._Fld595 = ?)) T131
- ON T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000D8 AND T95._Q_001_F_002_RRRef = T131.IDRRef
- LEFT OUTER JOIN (SELECT
- T142._Fld595 AS Fld595_,
- T142._Fld3752RRef AS Fld3752RRef,
- T142._IDRRef AS IDRRef,
- T142._Fld3734RRef AS Fld3734RRef
- FROM dbo._Document215 T142
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T143
- ON ((T142._Fld3734RRef = T143._IDRRef)) AND (T143._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T144
- INNER JOIN dbo._Reference21 T145
- ON (((T144._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T146
- WHERE ((T146._Fld595 = ?)) AND ((T146._Fld12065RRef = T144._IDRRef) AND (T146._Fld12066RRef = T145._IDRRef)))) AND T145._IDRRef IN
- (SELECT
- T147._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T147
- INNER JOIN dbo._InfoRg9937 T148
- ON ((T148._Fld9939_TYPE = 0x08 AND T148._Fld9939_RTRef = 0x00000095 AND T148._Fld9939_RRRef = ?) AND (T148._Fld9938_TYPE = T147._Fld784_TYPE AND T148._Fld9938_RTRef = T147._Fld784_RTRef AND T148._Fld9938_RRRef = T147._Fld784_RRRef))
- WHERE ((T147._Fld595 = ?)) AND (T148._Fld595 = ?)))
- WHERE ((T145._Fld595 = ?)) AND ((CASE WHEN T143._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T143._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T149
- WHERE ((T149._Fld595 = ?)) AND ((T149._Fld12072RRef = T145._IDRRef) AND (T149._Fld12073_TYPE = CASE WHEN T143._Fld12836RRef IS NOT NULL THEN 0x08 END AND T149._Fld12073_RTRef = CASE WHEN T143._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T149._Fld12073_RRRef = T143._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T150
- WHERE ((T150._Fld595 = ?)) AND ((T150._Fld12199RRef = T145._IDRRef) AND T150._Fld12200_TYPE = CASE WHEN T143._Fld12836RRef IS NOT NULL THEN 0x08 END AND T150._Fld12200_RTRef = CASE WHEN T143._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T150._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T142._Fld595 = ?)) T141
- ON T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000D7 AND T95._Q_001_F_002_RRRef = T141.IDRRef
- WHERE CASE WHEN (? = ?) THEN CASE WHEN ((CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T96.Fld4654RRef WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000D4 THEN T117._Fld3528RRef WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000EA THEN T118.Fld4798RRef WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x00000107 THEN T130._Fld6301RRef WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000D8 THEN T131.Fld3877RRef WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000D7 THEN T141.Fld3752RRef ELSE CAST(NULL AS BINARY(16)) END = ?) OR (CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T96.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END = ?)) THEN 0x01 WHEN NOT ((CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T96.Fld4654RRef WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000D4 THEN T117._Fld3528RRef WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000EA THEN T118.Fld4798RRef WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x00000107 THEN T130._Fld6301RRef WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000D8 THEN T131.Fld3877RRef WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000D7 THEN T141.Fld3752RRef ELSE CAST(NULL AS BINARY(16)) END = ?) OR (CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T96.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END = ?)) THEN 0x00 END END = 0x01
- GROUP BY T95._Q_001_F_000RRef,
- CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T96.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END,
- CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T116._Description ELSE CAST(NULL AS NVARCHAR(100)) END,
- T95._Q_001_F_000RRef,
- T106.Description_,
- T106.Description_,
- CASE WHEN T95._Q_001_F_002_TYPE = 0x08 AND T95._Q_001_F_002_RTRef = 0x000000E9 THEN T96.Fld12737RRef ELSE CAST(NULL AS BINARY(16)) END,
- T115._Description
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement