一张表中,比如表1,字段a,字段b,字段c
对于同一个C,取最小的A
当A相等的情况下,取最小的B。
select a, b, c
from (select ttt.*, row_number() over(partition by c order by a, b) rn
from ttt)
where rn = 1
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16115580/viewspace-1021821/ ,如需转载,请注明出处,否则将追究法律责任。