表名假设为table1,它其中有字段a,b,c,其中a,c是一组来分的,单每组只取其中第一条的b字段,如何写呢??
a b c
001 1 9-1
001 2 9-1
001 3 9-1
002 4 9-1
002 5 9-1
002 6 9-1
既我只取1,4两条数据即可,数据库为oracle,谢谢各位了
a b c
001 1 9-1
001 2 9-1
001 3 9-1
002 4 9-1
002 5 9-1
002 6 9-1
既我只取1,4两条数据即可,数据库为oracle,谢谢各位了
from (select a,b,c , row_number() over (partition by a,c order by b )d from table ) table1
where d = 1