sql server - How can I get the information that the start time is the end time in the next change according to the status of a data in the table in SQL? - Stack Overflow SQL Server 2022 | db<>fiddle 先 where v1 % 2 = 1 筛选出所有需要预警的窗口 再 partition by line, cl_name, v1 对每个窗口取 first 和 last