select a.Name,a.MN,b.DataTime,b.Y1,b.V1,b.K1,b.amp1,b.amp2,b.DYDL,b.DYDY,b.rownumber from t_d_Device a INNER JOIN
(
select row_number() over (partition by mn order by DataId DESC) as rownumber,* from t_o_data where datatime BETWEEN '2021-02-07 00:00:00' and '2021-02-07 23:00:00'
)
as b on a.MN=b.MN where b.rownumber<=20