我正在尝试使用over (分区)子句来选择一个使用max (noteid)选择记录的记录。,NoteID: 1410233但是,当我尝试使用over(分区)SQL时:
(select text from (select (Text), noteid, max(noteid) over (partition by driveid) as 'max_note
我正在尝试使用"over(partition)“语法获取特定的数据子集。我已经创建了示例数据来说明。运行以下CTE将产生一个小的示例结果集。我可以使用over(分区)语法获得#1,但我无法弄清楚#2。(partition by problemnumber) as MinDate, max(closedate) over(partition by problemnumber) as MaxDate) over(partition by problemnumber))
else NULL end as Days_t