необходимо получить из installations параметры assy на ближайшую дату
как-то красивше возможно?
как-то красивше возможно?
insert installations (date,assy) select '20170101',1 union all select '20170202',2 insert params (date,param1) select '20170105',100 union all select '20170203',200 select p.*,i.* from params p cross apply (select top(1) * from installations i where i.date<=p.date order by date desc) i