- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
select top 1000
[ObjectType] = N'Scv',
[SourceCodeId] = d.[IDOBJ],
[ParameterName] = N'DlitZamera',
[DateTime] = l1.[VALUEDATE],
[Value] = l1.[PERIOD],
[vValue] = NULL, [IsLive] = 1
from tm_mn_c8_kust.[dbo].[Lg] as l1
left join tm_mn_c8_kust.[dbo].[Lg] as l2 on (l1.IDOBJ=l2.IDOBJ and l1.ValueDATE<l2.ValueDATE)
inner join tm_mn_c8_kust.[dbo].[TiiDat] as d on d.IDDAT = l1.IDOBJ
where l1.TYPEOBJ=330 and
l1.IDPAR=15 and
l2.ValueDATE is null