Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (@P1 numeric(10),@P2 varbinary(16),@P3 varbinary(16),@P4 numeric(10),@P5 nvarchar(4000),@P6 numeric(10),@P7 varbinary(16),@P8 numeric(10),@P9 numeric(10),@P10 numeric(10),@P11 numeric(10),@P12 numeric(10),@P13 datetime2(3),@P14 varbinary(16),@P15 varbinary(16),@P16 numeric(10),@P17 numeric(10),@P18 numeric(10),@P19 datetime2(3),@P20 varbinary(16),@P21 varbinary(16),@P22 numeric(10),@P23 numeric(10),@P24 numeric(10),@P25 nvarchar(4000),@P26 numeric(10),@P27 varbinary(16),@P28 numeric(10),@P29 numeric(10),@P30 numeric(10),@P31 numeric(10),@P32 numeric(10),@P33 datetime2(3),@P34 datetime2(3),@P35 varbinary(16),@P36 varbinary(16),@P37 numeric(10),@P38 datetime2(3),@P39 datetime2(3),@P40 varbinary(16),@P41 varbinary(16),@P42 numeric(10),@P43 varbinary(16),@P44 varbinary(16),@P45 varbinary(16),@P46 numeric(10),@P47 datetime2(3),@P48 varbinary(16),@P49 varbinary(16),@P50 numeric(10),@P51 numeric(10),@P52 datetime2(3),@P53 datetime2(3),@P54 varbinary(16),@P55 varbinary(16),@P56 numeric(10),@P57 varbinary(16),@P58 varbinary(16),@P59 numeric(10),@P60 numeric(10),@P61 nvarchar(4000),@P62 numeric(10),@P63 varbinary(16),@P64 numeric(10),@P65 numeric(10),@P66 numeric(10),@P67 numeric(10),@P68 numeric(10),@P69 numeric(10),@P70 numeric(10),@P71 nvarchar(4000),@P72 numeric(10),@P73 varbinary(16),@P74 numeric(10),@P75 numeric(10),@P76 numeric(10),@P77 numeric(10),@P78 numeric(10),@P79 numeric(10),@P80 numeric(10),@P81 numeric(10),@P82 numeric(10),@P83 numeric(10),@P84 numeric(10),@P85 datetime2(3),@P86 varbinary(16),@P87 varbinary(16),@P88 numeric(10),@P89 numeric(10),@P90 numeric(10),@P91 nvarchar(4000),@P92 numeric(10),@P93 varbinary(16),@P94 numeric(10),@P95 numeric(10),@P96 numeric(10),@P97 numeric(10),@P98 numeric(10),@P99 numeric(10),@P100 numeric(10),@P101 nvarchar(4000),@P102 numeric(10),@P103 varbinary(16),@P104 numeric(10),@P105 numeric(10),@P106 numeric(10),@P107 numeric(10),@P108 numeric(10),@P109 numeric(10),@P110 numeric(10),@P111 numeric(10),@P112 numeric(10),@P113 numeric(10),@P114 numeric(10),@P115 datetime2(3),@P116 datetime2(3),@P117 varbinary(16),@P118 varbinary(16),@P119 varbinary(16),@P120 numeric(10),@P121 numeric(10),@P122 nvarchar(4000),@P123 numeric(10),@P124 varbinary(16),@P125 numeric(10),@P126 numeric(10),@P127 numeric(10),@P128 numeric(10),@P129 numeric(10),@P130 numeric(10),@P131 numeric(10),@P132 nvarchar(4000),@P133 numeric(10),@P134 varbinary(16),@P135 numeric(10),@P136 numeric(10),@P137 numeric(10),@P138 numeric(10),@P139 numeric(10),@P140 numeric(10),@P141 numeric(10),@P142 numeric(10),@P143 numeric(10),@P144 numeric(10),@P145 varbinary(16),@P146 varbinary(16),@P147 varbinary(16))INSERT INTO #tt47 WITH(TABLOCK) (_Q_001_F_000RRef, _Q_001_F_001, _Q_001_F_002RRef, _Q_001_F_003, _Q_001_F_004RRef) SELECT
- T1._Q_001_F_001RRef,
- T1._Q_001_F_002,
- T1._Q_001_F_003RRef,
- CASE WHEN (1=1) AND CASE WHEN 1=1 THEN CASE WHEN 1=1 THEN 0 ELSE 2000000000 END + 2000000000 ELSE 0 END = 2000000000 THEN CAST(SUM(ISNULL(CAST(CASE WHEN (T1._Q_001_F_000RRef = 0x00000000000000000000000000000000) THEN CAST(((CAST((CAST(T2._Q_001_F_000 AS NUMERIC(26, 2)) * CAST(T4._Q_000_F_001 AS NUMERIC(11, 6))) AS NUMERIC(29, 8)) * CAST(T1._Q_001_F_005 AS NUMERIC(8, 0))) / (T1._Q_001_F_004 * ISNULL(CAST(T4._Q_000_F_002 AS NUMERIC(10, 0)),1.0))) AS NUMERIC(15, 2)) ELSE T2._Q_001_F_000 END AS NUMERIC(33, 2)),0.0)) AS NUMERIC(38, 8)) END,
- T1._Q_001_F_000RRef
- FROM #tt45 T1 WITH(NOLOCK)
- LEFT OUTER JOIN #tt46 T2 WITH(NOLOCK)
- LEFT OUTER JOIN dbo._Reference43 T3
- ON (T2._Q_001_F_001RRef = T3._IDRRef) AND (T3._Fld595 = @P1)
- LEFT OUTER JOIN #tt44 T4 WITH(NOLOCK)
- ON (T3._Fld1083RRef = T4._Q_000_F_000RRef)
- ON CASE WHEN (T1._Q_001_F_000RRef = @P2) THEN 0x01 ELSE CASE WHEN (T1._Q_001_F_000RRef = T2._Q_001_F_001RRef) THEN 0x01 WHEN NOT (T1._Q_001_F_000RRef = T2._Q_001_F_001RRef) THEN 0x00 END END = 0x01
- WHERE (T1._Q_001_F_001RRef = @P3)
- GROUP BY T1._Q_001_F_001RRef,
- T1._Q_001_F_002,
- T1._Q_001_F_000RRef,
- T1._Q_001_F_003RRef
- UNION ALL SELECT
- T5._Q_001_F_001RRef,
- T5._Q_001_F_002,
- T5._Q_001_F_003RRef,
- CAST(SUM(ISNULL(CAST(CASE WHEN (T5._Q_001_F_000RRef = 0x00000000000000000000000000000000) THEN CAST(((CAST((CAST(T6.Fld11503Balance_ AS NUMERIC(26, 2)) * CAST(T29._Q_000_F_001 AS NUMERIC(11, 6))) AS NUMERIC(29, 8)) * CAST(T5._Q_001_F_005 AS NUMERIC(8, 0))) / (T5._Q_001_F_004 * ISNULL(CAST(T29._Q_000_F_002 AS NUMERIC(10, 0)),1.0))) AS NUMERIC(15, 2)) ELSE T6.Fld11503Balance_ END AS NUMERIC(33, 2)),0.0)) AS NUMERIC(38, 8)),
- T5._Q_001_F_000RRef
- FROM #tt45 T5 WITH(NOLOCK)
- LEFT OUTER JOIN (SELECT
- MIN(ISNULL(T7.SDBL_RLS_SIGNAL_,0x01)) AS SDBL_RLS_SIGNAL_,
- T7.Fld11497RRef AS Fld11497RRef,
- CAST(SUM(T7.Fld11503Balance_) AS NUMERIC(38, 8)) AS Fld11503Balance_
- FROM (SELECT
- MIN(T8.SDBL_RLS_SIGNAL_) AS SDBL_RLS_SIGNAL_,
- T8.Fld11497RRef AS Fld11497RRef,
- CAST(SUM(T8.Fld11503_) AS NUMERIC(33, 8)) AS Fld11503Balance_
- FROM (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T10
- ON ((T9._Fld11496RRef = T10._IDRRef)) AND (T10._Fld595 = @P4)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T11
- INNER JOIN dbo._Reference21 T12
- ON (((T11._Fld1685 = @P5) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T13
- WHERE ((T13._Fld595 = @P6)) AND ((T13._Fld12065RRef = T11._IDRRef) AND (T13._Fld12066RRef = T12._IDRRef)))) AND T12._IDRRef IN
- (SELECT
- T14._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T14
- INNER JOIN dbo._InfoRg9937 T15
- ON ((T15._Fld9939_TYPE = 0x08 AND T15._Fld9939_RTRef = 0x00000095 AND T15._Fld9939_RRRef = @P7) AND (T15._Fld9938_TYPE = T14._Fld784_TYPE AND T15._Fld9938_RTRef = T14._Fld784_RTRef AND T15._Fld9938_RRRef = T14._Fld784_RRRef))
- WHERE ((T14._Fld595 = @P8)) AND (T15._Fld595 = @P9)))
- WHERE ((T12._Fld595 = @P10)) AND ((CASE WHEN T10._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T10._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T16
- WHERE ((T16._Fld595 = @P11)) AND ((T16._Fld12072RRef = T12._IDRRef) AND (T16._Fld12073_TYPE = CASE WHEN T10._Fld12836RRef IS NOT NULL THEN 0x08 END AND T16._Fld12073_RTRef = CASE WHEN T10._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T16._Fld12073_RRRef = T10._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T17
- WHERE ((T17._Fld595 = @P12)) AND ((T17._Fld12199RRef = T12._IDRRef) AND T17._Fld12200_TYPE = CASE WHEN T10._Fld12836RRef IS NOT NULL THEN 0x08 END AND T17._Fld12200_RTRef = CASE WHEN T10._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T17._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T9._Fld11503 AS Fld11503_,
- T9._Fld595 AS Fld595_,
- T9._Fld11497RRef AS Fld11497RRef,
- T9._Fld11496RRef AS Fld11496RRef,
- T9._Period AS Period_,
- T9._Fld11494RRef AS Fld11494RRef
- FROM dbo._AccumRgT11507 T9
- WHERE (T9._Period = @P13 AND T9._Fld11494RRef = @P14 AND T9._Fld11496RRef = @P15 AND T9._Fld11503 <> @P16 AND T9._Fld11503 <> @P17) AND (T9._Fld595 = @P18)) T8
- WHERE T8.Period_ = @P19 AND (((T8.Fld11494RRef = @P20) AND (T8.Fld11496RRef = @P21))) AND (T8.Fld11503_ <> @P22) AND (T8.Fld11503_ <> @P23)
- GROUP BY T8.Fld11497RRef
- HAVING (CAST(SUM(T8.Fld11503_) AS NUMERIC(33, 8))) <> 0.0
- UNION ALL SELECT
- MIN(T18.SDBL_RLS_SIGNAL_) AS SDBL_RLS_SIGNAL_,
- T18.Fld11497RRef AS Fld11497RRef,
- CAST(CAST(SUM(CASE WHEN T18.RecordKind_ = 0.0 THEN -T18.Fld11503_ ELSE T18.Fld11503_ END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld11503Balance_
- FROM (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T20
- ON ((T19._Fld11496RRef = T20._IDRRef)) AND (T20._Fld595 = @P24)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T21
- INNER JOIN dbo._Reference21 T22
- ON (((T21._Fld1685 = @P25) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T23
- WHERE ((T23._Fld595 = @P26)) AND ((T23._Fld12065RRef = T21._IDRRef) AND (T23._Fld12066RRef = T22._IDRRef)))) AND T22._IDRRef IN
- (SELECT
- T24._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T24
- INNER JOIN dbo._InfoRg9937 T25
- ON ((T25._Fld9939_TYPE = 0x08 AND T25._Fld9939_RTRef = 0x00000095 AND T25._Fld9939_RRRef = @P27) AND (T25._Fld9938_TYPE = T24._Fld784_TYPE AND T25._Fld9938_RTRef = T24._Fld784_RTRef AND T25._Fld9938_RRRef = T24._Fld784_RRRef))
- WHERE ((T24._Fld595 = @P28)) AND (T25._Fld595 = @P29)))
- WHERE ((T22._Fld595 = @P30)) AND ((CASE WHEN T20._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T20._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T26
- WHERE ((T26._Fld595 = @P31)) AND ((T26._Fld12072RRef = T22._IDRRef) AND (T26._Fld12073_TYPE = CASE WHEN T20._Fld12836RRef IS NOT NULL THEN 0x08 END AND T26._Fld12073_RTRef = CASE WHEN T20._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T26._Fld12073_RRRef = T20._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T27
- WHERE ((T27._Fld595 = @P32)) AND ((T27._Fld12199RRef = T22._IDRRef) AND T27._Fld12200_TYPE = CASE WHEN T20._Fld12836RRef IS NOT NULL THEN 0x08 END AND T27._Fld12200_RTRef = CASE WHEN T20._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T27._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T19._RecordKind AS RecordKind_,
- T19._Period AS Period_,
- T19._Fld11494RRef AS Fld11494RRef,
- T19._Fld11503 AS Fld11503_,
- T19._Fld595 AS Fld595_,
- T19._Fld11497RRef AS Fld11497RRef,
- T19._Fld11496RRef AS Fld11496RRef,
- T19._Active AS Active_
- FROM dbo._AccumRg11493 T19
- WHERE (T19._Period >= @P33 AND T19._Period < @P34 AND T19._Fld11494RRef = @P35 AND T19._Fld11496RRef = @P36) AND (T19._Fld595 = @P37)) T18
- WHERE T18.Period_ >= @P38 AND T18.Period_ < @P39 AND T18.Active_ = 0x01 AND (((T18.Fld11494RRef = @P40) AND (T18.Fld11496RRef = @P41)))
- GROUP BY T18.Fld11497RRef
- HAVING (CAST(CAST(SUM(CASE WHEN T18.RecordKind_ = 0.0 THEN -T18.Fld11503_ ELSE T18.Fld11503_ END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T7
- GROUP BY T7.Fld11497RRef
- HAVING (CAST(SUM(T7.Fld11503Balance_) AS NUMERIC(38, 8))) <> 0.0) T6
- LEFT OUTER JOIN dbo._Reference43 T28
- ON (T6.Fld11497RRef = T28._IDRRef) AND (T28._Fld595 = @P42)
- LEFT OUTER JOIN #tt44 T29 WITH(NOLOCK)
- ON (T28._Fld1083RRef = T29._Q_000_F_000RRef)
- ON CASE WHEN (T5._Q_001_F_000RRef = @P43) THEN 0x01 ELSE CASE WHEN (T5._Q_001_F_000RRef = T6.Fld11497RRef) THEN 0x01 WHEN NOT (T5._Q_001_F_000RRef = T6.Fld11497RRef) THEN 0x00 END END = 0x01
- WHERE ((T5._Q_001_F_001RRef = @P44)) AND CASE WHEN (T28._IDRRef = T28._IDRRef OR T28._IDRRef IS NULL) AND (T29._Q_000_F_000RRef = T29._Q_000_F_000RRef OR T29._Q_000_F_000RRef IS NULL) AND (T5._Q_001_F_001RRef = @P45) THEN CASE WHEN ISNULL(T6.SDBL_RLS_SIGNAL_,0x01) = 0x01 THEN 0 ELSE 2000000000 END + 2000000000 ELSE 0 END = 2000000000
- GROUP BY T5._Q_001_F_001RRef,
- T5._Q_001_F_002,
- T5._Q_001_F_000RRef,
- T5._Q_001_F_003RRef
- UNION ALL SELECT
- T30._Q_001_F_001RRef,
- T30._Q_001_F_002,
- T30._Q_001_F_003RRef,
- CAST(SUM(ISNULL(CAST(CASE WHEN (T30._Q_001_F_000RRef = 0x00000000000000000000000000000000) THEN CAST(((CAST((CAST(T31.Fld11330Turnover_ AS NUMERIC(26, 2)) * CAST(T36._Q_000_F_001 AS NUMERIC(11, 6))) AS NUMERIC(29, 8)) * CAST(T30._Q_001_F_005 AS NUMERIC(8, 0))) / (T30._Q_001_F_004 * ISNULL(CAST(T36._Q_000_F_002 AS NUMERIC(10, 0)),1.0))) AS NUMERIC(15, 2)) ELSE T31.Fld11330Turnover_ END AS NUMERIC(33, 2)),0.0)) AS NUMERIC(38, 8)),
- T30._Q_001_F_000RRef
- FROM #tt45 T30 WITH(NOLOCK)
- LEFT OUTER JOIN (SELECT
- MIN(T32.SDBL_RLS_SIGNAL_) AS SDBL_RLS_SIGNAL_,
- T32.Fld11326RRef AS Fld11326RRef,
- CAST(SUM(T32.Fld11330Turnover_) AS NUMERIC(38, 8)) AS Fld11330Turnover_
- FROM (SELECT
- 0x01 AS SDBL_RLS_SIGNAL_,
- T33._Fld11326RRef AS Fld11326RRef,
- CAST(SUM(T33._Fld11330) AS NUMERIC(33, 8)) AS Fld11330Turnover_
- FROM dbo._AccumRgTn11332 T33
- WHERE ((T33._Fld595 = @P46)) AND (T33._Period < @P47 AND (((T33._Fld11324RRef = @P48) AND (T33._Fld11325RRef = @P49))) AND (T33._Fld11330 <> @P50))
- GROUP BY T33._Fld11326RRef
- HAVING (CAST(SUM(T33._Fld11330) AS NUMERIC(33, 8))) <> 0.0
- UNION ALL SELECT
- 0x01 AS SDBL_RLS_SIGNAL_,
- T34._Fld11326RRef AS Fld11326RRef,
- CAST(CAST(SUM(T34._Fld11330) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld11330Turnover_
- FROM dbo._AccumRg11323 T34
- WHERE ((T34._Fld595 = @P51)) AND (T34._Period >= @P52 AND T34._Period <= @P53 AND T34._Active = 0x01 AND (((T34._Fld11324RRef = @P54) AND (T34._Fld11325RRef = @P55))))
- GROUP BY T34._Fld11326RRef
- HAVING (CAST(CAST(SUM(T34._Fld11330) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T32
- GROUP BY T32.Fld11326RRef
- HAVING (CAST(SUM(T32.Fld11330Turnover_) AS NUMERIC(38, 8))) <> 0.0) T31
- LEFT OUTER JOIN dbo._Reference43 T35
- ON (T31.Fld11326RRef = T35._IDRRef) AND (T35._Fld595 = @P56)
- LEFT OUTER JOIN #tt44 T36 WITH(NOLOCK)
- ON (T35._Fld1083RRef = T36._Q_000_F_000RRef)
- ON CASE WHEN (T30._Q_001_F_000RRef = @P57) THEN 0x01 ELSE CASE WHEN (T30._Q_001_F_000RRef = T31.Fld11326RRef) THEN 0x01 WHEN NOT (T30._Q_001_F_000RRef = T31.Fld11326RRef) THEN 0x00 END END = 0x01
- WHERE (T30._Q_001_F_001RRef = @P58)
- GROUP BY T30._Q_001_F_001RRef,
- T30._Q_001_F_002,
- T30._Q_001_F_000RRef,
- T30._Q_001_F_003RRef
- UNION ALL SELECT
- T37._Q_001_F_001RRef,
- T37._Q_001_F_002,
- T37._Q_001_F_003RRef,
- CAST(CAST(SUM(ISNULL(CAST(CAST(((CAST((CAST(T38.Fld11255Turnover_ AS NUMERIC(26, 2)) * CAST(T92._Q_000_F_001 AS NUMERIC(11, 6))) AS NUMERIC(29, 8)) * CAST(T37._Q_001_F_005 AS NUMERIC(8, 0))) / (T37._Q_001_F_004 * ISNULL(CAST(T92._Q_000_F_002 AS NUMERIC(10, 0)),1.0))) AS NUMERIC(15, 2)) AS NUMERIC(15, 2)),0.0)) AS NUMERIC(27, 8)) AS NUMERIC(38, 8)),
- T37._Q_001_F_000RRef
- FROM #tt45 T37 WITH(NOLOCK)
- LEFT OUTER JOIN (SELECT
- MIN(ISNULL(T39.SDBL_RLS_SIGNAL_,0x01)) AS SDBL_RLS_SIGNAL_,
- T39.Fld11251_TYPE AS Fld11251_TYPE,
- T39.Fld11251_RTRef AS Fld11251_RTRef,
- T39.Fld11251_RRRef AS Fld11251_RRRef,
- CAST(SUM(T39.Fld11255Turnover_) AS NUMERIC(38, 8)) AS Fld11255Turnover_
- FROM (SELECT
- MIN(CASE WHEN ISNULL(T42.SDBL_RLS_SIGNAL_,0x01) = 0x01 AND ISNULL(T52.SDBL_RLS_SIGNAL_,0x01) = 0x01 THEN 0x01 ELSE 0x00 END) AS SDBL_RLS_SIGNAL_,
- T40._Fld11251_TYPE AS Fld11251_TYPE,
- T40._Fld11251_RTRef AS Fld11251_RTRef,
- T40._Fld11251_RRRef AS Fld11251_RRRef,
- CAST(SUM(T40._Fld11255) AS NUMERIC(33, 8)) AS Fld11255Turnover_
- FROM dbo._AccumRgTn11257 T40
- LEFT OUTER JOIN dbo._Document218 T41
- ON (T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000DA AND T40._Fld11251_RRRef = T41._IDRRef) AND (T41._Fld595 = @P59)
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T44
- ON ((T43._Fld4625RRef = T44._IDRRef)) AND (T44._Fld595 = @P60)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T45
- INNER JOIN dbo._Reference21 T46
- ON (((T45._Fld1685 = @P61) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T47
- WHERE ((T47._Fld595 = @P62)) AND ((T47._Fld12065RRef = T45._IDRRef) AND (T47._Fld12066RRef = T46._IDRRef)))) AND T46._IDRRef IN
- (SELECT
- T48._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T48
- INNER JOIN dbo._InfoRg9937 T49
- ON ((T49._Fld9939_TYPE = 0x08 AND T49._Fld9939_RTRef = 0x00000095 AND T49._Fld9939_RRRef = @P63) AND (T49._Fld9938_TYPE = T48._Fld784_TYPE AND T49._Fld9938_RTRef = T48._Fld784_RTRef AND T49._Fld9938_RRRef = T48._Fld784_RRRef))
- WHERE ((T48._Fld595 = @P64)) AND (T49._Fld595 = @P65)))
- WHERE ((T46._Fld595 = @P66)) AND ((CASE WHEN T44._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T50
- WHERE ((T50._Fld595 = @P67)) AND ((T50._Fld12072RRef = T46._IDRRef) AND (T50._Fld12073_TYPE = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x08 END AND T50._Fld12073_RTRef = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T50._Fld12073_RRRef = T44._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T51
- WHERE ((T51._Fld595 = @P68)) AND ((T51._Fld12199RRef = T46._IDRRef) AND T51._Fld12200_TYPE = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x08 END AND T51._Fld12200_RTRef = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T51._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T43._IDRRef AS IDRRef,
- T43._Fld4625RRef AS Fld4625RRef,
- T43._Fld595 AS Fld595_
- FROM dbo._Document233 T43
- WHERE (T43._Fld595 = @P69)) T42
- ON T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000E9 AND T40._Fld11251_RRRef = T42.IDRRef
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T54
- ON ((T53._Fld4774RRef = T54._IDRRef)) AND (T54._Fld595 = @P70)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T55
- INNER JOIN dbo._Reference21 T56
- ON (((T55._Fld1685 = @P71) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T57
- WHERE ((T57._Fld595 = @P72)) AND ((T57._Fld12065RRef = T55._IDRRef) AND (T57._Fld12066RRef = T56._IDRRef)))) AND T56._IDRRef IN
- (SELECT
- T58._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T58
- INNER JOIN dbo._InfoRg9937 T59
- ON ((T59._Fld9939_TYPE = 0x08 AND T59._Fld9939_RTRef = 0x00000095 AND T59._Fld9939_RRRef = @P73) AND (T59._Fld9938_TYPE = T58._Fld784_TYPE AND T59._Fld9938_RTRef = T58._Fld784_RTRef AND T59._Fld9938_RRRef = T58._Fld784_RRRef))
- WHERE ((T58._Fld595 = @P74)) AND (T59._Fld595 = @P75)))
- WHERE ((T56._Fld595 = @P76)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T60
- WHERE ((T60._Fld595 = @P77)) AND ((T60._Fld12072RRef = T56._IDRRef) AND (T60._Fld12073_TYPE = 0x08 AND T60._Fld12073_RTRef = 0x0000001C AND T60._Fld12073_RRRef = T53._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T61
- WHERE ((T61._Fld595 = @P78)) AND ((T61._Fld12199RRef = T56._IDRRef) AND T61._Fld12200_TYPE = 0x08 AND T61._Fld12200_RTRef = 0x0000001C AND (T61._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T54._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T54._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T62
- WHERE ((T62._Fld595 = @P79)) AND ((T62._Fld12072RRef = T56._IDRRef) AND (T62._Fld12073_TYPE = CASE WHEN T54._Fld12836RRef IS NOT NULL THEN 0x08 END AND T62._Fld12073_RTRef = CASE WHEN T54._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T62._Fld12073_RRRef = T54._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T63
- WHERE ((T63._Fld595 = @P80)) AND ((T63._Fld12199RRef = T56._IDRRef) AND T63._Fld12200_TYPE = CASE WHEN T54._Fld12836RRef IS NOT NULL THEN 0x08 END AND T63._Fld12200_RTRef = CASE WHEN T54._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T63._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T53._IDRRef AS IDRRef,
- T53._Fld595 AS Fld595_,
- T53._Fld4774RRef AS Fld4774RRef,
- T53._Fld4779RRef AS Fld4779RRef
- FROM dbo._Document234 T53
- WHERE (T53._Fld595 = @P81)) T52
- ON T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000EA AND T40._Fld11251_RRRef = T52.IDRRef
- LEFT OUTER JOIN dbo._Document286 T64
- ON (T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x0000011E AND T40._Fld11251_RRRef = T64._IDRRef) AND (T64._Fld595 = @P82)
- LEFT OUTER JOIN dbo._Document199 T65
- ON (T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000C7 AND T40._Fld11251_RRRef = T65._IDRRef) AND (T65._Fld595 = @P83)
- WHERE ((T40._Fld595 = @P84)) AND (T40._Period < @P85 AND (((T40._Fld11246RRef = @P86) AND (CASE WHEN T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000DA THEN T41._Fld4083RRef WHEN T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000E9 THEN T42.Fld4625RRef WHEN T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000EA THEN T52.Fld4774RRef WHEN T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x0000011E THEN T64._Fld7289RRef WHEN T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000C7 THEN T65._Fld2840RRef ELSE CAST(NULL AS BINARY(16)) END = @P87))) AND (T40._Fld11255 <> @P88))
- GROUP BY T40._Fld11251_TYPE,
- T40._Fld11251_RTRef,
- T40._Fld11251_RRRef
- HAVING (CAST(SUM(T40._Fld11255) AS NUMERIC(33, 8))) <> 0.0
- UNION ALL SELECT
- MIN(CASE WHEN ISNULL(T68.SDBL_RLS_SIGNAL_,0x01) = 0x01 AND ISNULL(T78.SDBL_RLS_SIGNAL_,0x01) = 0x01 THEN 0x01 ELSE 0x00 END) AS SDBL_RLS_SIGNAL_,
- T66._Fld11251_TYPE AS Fld11251_TYPE,
- T66._Fld11251_RTRef AS Fld11251_RTRef,
- T66._Fld11251_RRRef AS Fld11251_RRRef,
- CAST(CAST(SUM(T66._Fld11255) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld11255Turnover_
- FROM dbo._AccumRg11245 T66
- LEFT OUTER JOIN dbo._Document218 T67
- ON (T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000DA AND T66._Fld11251_RRRef = T67._IDRRef) AND (T67._Fld595 = @P89)
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T70
- ON ((T69._Fld4625RRef = T70._IDRRef)) AND (T70._Fld595 = @P90)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T71
- INNER JOIN dbo._Reference21 T72
- ON (((T71._Fld1685 = @P91) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T73
- WHERE ((T73._Fld595 = @P92)) AND ((T73._Fld12065RRef = T71._IDRRef) AND (T73._Fld12066RRef = T72._IDRRef)))) AND T72._IDRRef IN
- (SELECT
- T74._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T74
- INNER JOIN dbo._InfoRg9937 T75
- ON ((T75._Fld9939_TYPE = 0x08 AND T75._Fld9939_RTRef = 0x00000095 AND T75._Fld9939_RRRef = @P93) AND (T75._Fld9938_TYPE = T74._Fld784_TYPE AND T75._Fld9938_RTRef = T74._Fld784_RTRef AND T75._Fld9938_RRRef = T74._Fld784_RRRef))
- WHERE ((T74._Fld595 = @P94)) AND (T75._Fld595 = @P95)))
- WHERE ((T72._Fld595 = @P96)) AND ((CASE WHEN T70._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T70._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T76
- WHERE ((T76._Fld595 = @P97)) AND ((T76._Fld12072RRef = T72._IDRRef) AND (T76._Fld12073_TYPE = CASE WHEN T70._Fld12836RRef IS NOT NULL THEN 0x08 END AND T76._Fld12073_RTRef = CASE WHEN T70._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T76._Fld12073_RRRef = T70._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T77
- WHERE ((T77._Fld595 = @P98)) AND ((T77._Fld12199RRef = T72._IDRRef) AND T77._Fld12200_TYPE = CASE WHEN T70._Fld12836RRef IS NOT NULL THEN 0x08 END AND T77._Fld12200_RTRef = CASE WHEN T70._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T77._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T69._IDRRef AS IDRRef,
- T69._Fld4625RRef AS Fld4625RRef,
- T69._Fld595 AS Fld595_
- FROM dbo._Document233 T69
- WHERE (T69._Fld595 = @P99)) T68
- ON T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000E9 AND T66._Fld11251_RRRef = T68.IDRRef
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T80
- ON ((T79._Fld4774RRef = T80._IDRRef)) AND (T80._Fld595 = @P100)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T81
- INNER JOIN dbo._Reference21 T82
- ON (((T81._Fld1685 = @P101) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T83
- WHERE ((T83._Fld595 = @P102)) AND ((T83._Fld12065RRef = T81._IDRRef) AND (T83._Fld12066RRef = T82._IDRRef)))) AND T82._IDRRef IN
- (SELECT
- T84._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T84
- INNER JOIN dbo._InfoRg9937 T85
- ON ((T85._Fld9939_TYPE = 0x08 AND T85._Fld9939_RTRef = 0x00000095 AND T85._Fld9939_RRRef = @P103) AND (T85._Fld9938_TYPE = T84._Fld784_TYPE AND T85._Fld9938_RTRef = T84._Fld784_RTRef AND T85._Fld9938_RRRef = T84._Fld784_RRRef))
- WHERE ((T84._Fld595 = @P104)) AND (T85._Fld595 = @P105)))
- WHERE ((T82._Fld595 = @P106)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T86
- WHERE ((T86._Fld595 = @P107)) AND ((T86._Fld12072RRef = T82._IDRRef) AND (T86._Fld12073_TYPE = 0x08 AND T86._Fld12073_RTRef = 0x0000001C AND T86._Fld12073_RRRef = T79._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T87
- WHERE ((T87._Fld595 = @P108)) AND ((T87._Fld12199RRef = T82._IDRRef) AND T87._Fld12200_TYPE = 0x08 AND T87._Fld12200_RTRef = 0x0000001C AND (T87._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T80._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T88
- WHERE ((T88._Fld595 = @P109)) AND ((T88._Fld12072RRef = T82._IDRRef) AND (T88._Fld12073_TYPE = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x08 END AND T88._Fld12073_RTRef = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T88._Fld12073_RRRef = T80._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T89
- WHERE ((T89._Fld595 = @P110)) AND ((T89._Fld12199RRef = T82._IDRRef) AND T89._Fld12200_TYPE = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x08 END AND T89._Fld12200_RTRef = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T89._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T79._IDRRef AS IDRRef,
- T79._Fld595 AS Fld595_,
- T79._Fld4774RRef AS Fld4774RRef,
- T79._Fld4779RRef AS Fld4779RRef
- FROM dbo._Document234 T79
- WHERE (T79._Fld595 = @P111)) T78
- ON T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000EA AND T66._Fld11251_RRRef = T78.IDRRef
- LEFT OUTER JOIN dbo._Document286 T90
- ON (T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x0000011E AND T66._Fld11251_RRRef = T90._IDRRef) AND (T90._Fld595 = @P112)
- LEFT OUTER JOIN dbo._Document199 T91
- ON (T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000C7 AND T66._Fld11251_RRRef = T91._IDRRef) AND (T91._Fld595 = @P113)
- WHERE ((T66._Fld595 = @P114)) AND (T66._Period >= @P115 AND T66._Period <= @P116 AND T66._Active = 0x01 AND (((T66._Fld11246RRef = @P117) AND (CASE WHEN T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000DA THEN T67._Fld4083RRef WHEN T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000E9 THEN T68.Fld4625RRef WHEN T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000EA THEN T78.Fld4774RRef WHEN T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x0000011E THEN T90._Fld7289RRef WHEN T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000C7 THEN T91._Fld2840RRef ELSE CAST(NULL AS BINARY(16)) END = @P118))))
- GROUP BY T66._Fld11251_TYPE,
- T66._Fld11251_RTRef,
- T66._Fld11251_RRRef
- HAVING (CAST(CAST(SUM(T66._Fld11255) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T39
- GROUP BY T39.Fld11251_TYPE,
- T39.Fld11251_RTRef,
- T39.Fld11251_RRRef
- HAVING (CAST(SUM(T39.Fld11255Turnover_) AS NUMERIC(38, 8))) <> 0.0) T38
- LEFT OUTER JOIN #tt44 T92 WITH(NOLOCK)
- ON (T92._Q_000_F_000RRef = @P119)
- LEFT OUTER JOIN dbo._Document218 T93
- ON (T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000DA AND T38.Fld11251_RRRef = T93._IDRRef) AND (T93._Fld595 = @P120)
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T96
- ON ((T95._Fld4625RRef = T96._IDRRef)) AND (T96._Fld595 = @P121)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T97
- INNER JOIN dbo._Reference21 T98
- ON (((T97._Fld1685 = @P122) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T99
- WHERE ((T99._Fld595 = @P123)) AND ((T99._Fld12065RRef = T97._IDRRef) AND (T99._Fld12066RRef = T98._IDRRef)))) AND T98._IDRRef IN
- (SELECT
- T100._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T100
- INNER JOIN dbo._InfoRg9937 T101
- ON ((T101._Fld9939_TYPE = 0x08 AND T101._Fld9939_RTRef = 0x00000095 AND T101._Fld9939_RRRef = @P124) AND (T101._Fld9938_TYPE = T100._Fld784_TYPE AND T101._Fld9938_RTRef = T100._Fld784_RTRef AND T101._Fld9938_RRRef = T100._Fld784_RRRef))
- WHERE ((T100._Fld595 = @P125)) AND (T101._Fld595 = @P126)))
- WHERE ((T98._Fld595 = @P127)) AND ((CASE WHEN T96._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T96._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T102
- WHERE ((T102._Fld595 = @P128)) AND ((T102._Fld12072RRef = T98._IDRRef) AND (T102._Fld12073_TYPE = CASE WHEN T96._Fld12836RRef IS NOT NULL THEN 0x08 END AND T102._Fld12073_RTRef = CASE WHEN T96._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T102._Fld12073_RRRef = T96._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T103
- WHERE ((T103._Fld595 = @P129)) AND ((T103._Fld12199RRef = T98._IDRRef) AND T103._Fld12200_TYPE = CASE WHEN T96._Fld12836RRef IS NOT NULL THEN 0x08 END AND T103._Fld12200_RTRef = CASE WHEN T96._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T103._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T95._IDRRef AS IDRRef,
- T95._Fld4625RRef AS Fld4625RRef,
- T95._Fld4627RRef AS Fld4627RRef,
- T95._Fld595 AS Fld595_
- FROM dbo._Document233 T95
- WHERE (T95._Fld595 = @P130)) T94
- ON T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000E9 AND T38.Fld11251_RRRef = T94.IDRRef
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T106
- ON ((T105._Fld4774RRef = T106._IDRRef)) AND (T106._Fld595 = @P131)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T107
- INNER JOIN dbo._Reference21 T108
- ON (((T107._Fld1685 = @P132) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T109
- WHERE ((T109._Fld595 = @P133)) AND ((T109._Fld12065RRef = T107._IDRRef) AND (T109._Fld12066RRef = T108._IDRRef)))) AND T108._IDRRef IN
- (SELECT
- T110._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T110
- INNER JOIN dbo._InfoRg9937 T111
- ON ((T111._Fld9939_TYPE = 0x08 AND T111._Fld9939_RTRef = 0x00000095 AND T111._Fld9939_RRRef = @P134) AND (T111._Fld9938_TYPE = T110._Fld784_TYPE AND T111._Fld9938_RTRef = T110._Fld784_RTRef AND T111._Fld9938_RRRef = T110._Fld784_RRRef))
- WHERE ((T110._Fld595 = @P135)) AND (T111._Fld595 = @P136)))
- WHERE ((T108._Fld595 = @P137)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T112
- WHERE ((T112._Fld595 = @P138)) AND ((T112._Fld12072RRef = T108._IDRRef) AND (T112._Fld12073_TYPE = 0x08 AND T112._Fld12073_RTRef = 0x0000001C AND T112._Fld12073_RRRef = T105._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T113
- WHERE ((T113._Fld595 = @P139)) AND ((T113._Fld12199RRef = T108._IDRRef) AND T113._Fld12200_TYPE = 0x08 AND T113._Fld12200_RTRef = 0x0000001C AND (T113._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T106._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T106._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T114
- WHERE ((T114._Fld595 = @P140)) AND ((T114._Fld12072RRef = T108._IDRRef) AND (T114._Fld12073_TYPE = CASE WHEN T106._Fld12836RRef IS NOT NULL THEN 0x08 END AND T114._Fld12073_RTRef = CASE WHEN T106._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T114._Fld12073_RRRef = T106._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T115
- WHERE ((T115._Fld595 = @P141)) AND ((T115._Fld12199RRef = T108._IDRRef) AND T115._Fld12200_TYPE = CASE WHEN T106._Fld12836RRef IS NOT NULL THEN 0x08 END AND T115._Fld12200_RTRef = CASE WHEN T106._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T115._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T105._IDRRef AS IDRRef,
- T105._Fld595 AS Fld595_,
- T105._Fld4774RRef AS Fld4774RRef,
- T105._Fld4776RRef AS Fld4776RRef,
- T105._Fld4779RRef AS Fld4779RRef
- FROM dbo._Document234 T105
- WHERE (T105._Fld595 = @P142)) T104
- ON T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000EA AND T38.Fld11251_RRRef = T104.IDRRef
- LEFT OUTER JOIN dbo._Document286 T116
- ON (T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x0000011E AND T38.Fld11251_RRRef = T116._IDRRef) AND (T116._Fld595 = @P143)
- LEFT OUTER JOIN dbo._Document199 T117
- ON (T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000C7 AND T38.Fld11251_RRRef = T117._IDRRef) AND (T117._Fld595 = @P144)
- ON CASE WHEN (T37._Q_001_F_000RRef = @P145) THEN 0x01 ELSE CASE WHEN (T37._Q_001_F_000RRef = CASE WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000DA THEN T93._Fld4084RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000E9 THEN T94.Fld4627RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000EA THEN T104.Fld4776RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x0000011E THEN T116._Fld7290RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000C7 THEN T117._Fld2841RRef ELSE CAST(NULL AS BINARY(16)) END) THEN 0x01 WHEN NOT (T37._Q_001_F_000RRef = CASE WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000DA THEN T93._Fld4084RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000E9 THEN T94.Fld4627RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000EA THEN T104.Fld4776RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x0000011E THEN T116._Fld7290RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000C7 THEN T117._Fld2841RRef ELSE CAST(NULL AS BINARY(16)) END) THEN 0x00 END END = 0x01
- WHERE ((T37._Q_001_F_001RRef = @P146)) AND CASE WHEN (T116._IDRRef = T116._IDRRef OR T116._IDRRef IS NULL) AND (T117._IDRRef = T117._IDRRef OR T117._IDRRef IS NULL) AND (T92._Q_000_F_000RRef = T92._Q_000_F_000RRef OR T92._Q_000_F_000RRef IS NULL) AND (T93._IDRRef = T93._IDRRef OR T93._IDRRef IS NULL) AND (T37._Q_001_F_001RRef = @P147) THEN CASE WHEN ISNULL(T38.SDBL_RLS_SIGNAL_,0x01) = 0x01 AND ISNULL(T94.SDBL_RLS_SIGNAL_,0x01) = 0x01 AND ISNULL(T104.SDBL_RLS_SIGNAL_,0x01) = 0x01 THEN 0 ELSE 2000000000 END + 2000000000 ELSE 0 END = 2000000000
- GROUP BY T37._Q_001_F_001RRef,
- T37._Q_001_F_002,
- T37._Q_001_F_000RRef,
- T37._Q_001_F_003RRef
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement