3,496
社区成员
发帖
与我相关
我的任务
分享
10:51:03 scott@TUNGKONG> select * from tb2;
SO_NBR ID
-------------------- ----------
200153000516 100501
200153000516 1
200153000515 100516
200153000515 1
已用时间: 00: 00: 00.00
10:51:08 scott@TUNGKONG> select so_nbr,max(id) over(partition by so_nbr) col1,min(id) over(partition by so_nbr) col2 from tb2
10:51:11 2 /
SO_NBR COL1 COL2
-------------------- ---------- ----------
200153000515 100516 1
200153000515 100516 1
200153000516 100501 1
200153000516 100501 1
已用时间: 00: 00: 00.0110:51:03 scott@TUNGKONG> select * from tb2;
SO_NBR ID
-------------------- ----------
200153000516 100501
200153000516 1
200153000515 100516
200153000515 1
已用时间: 00: 00: 00.00
10:51:08 scott@TUNGKONG> select so_nbr,max(id) over(partition by so_nbr) col1,min(id) over(partition by so_nbr) col2 from tb2
10:51:11 2 /
SO_NBR COL1 COL2
-------------------- ---------- ----------
200153000515 100516 1
200153000515 100516 1
200153000516 100501 1
200153000516 100501 1
已用时间: 00: 00: 00.01