是否可能select只从基表列没有列出所有的列,这意味着所有列wihout rn列。这行不通的。。
select
rn
select tt.t.* from (
来源:
select * from ( select t.*, row_number() over(partition by id order by anumber) rn from mytable t where option ) tt where rn = 1 order by id
gcuhipw91#
假设这与question相关:您可以通过将子查询与表连接来实现此操作:
select t.* from ( select t.*, row_number() over(partition by id order by anumber) rn from mytable t where option ) tt inner join mytable t on t.ID = tt.ID and t.ANUMBER = tt.ANUMBER where rn = 1 order by t.id
1条答案
按热度按时间gcuhipw91#
假设这与question相关:
您可以通过将子查询与表连接来实现此操作: