SELECT * FROM(
SELECT t.type , t.money ,ROW_NUMBER() OVER(PARTITION BY t.type ORDER BY t.time) AS temp
FROM table1 t
)
WHERE temp =1;
这里涉及到的over()是oracle的分析函数
参考sql reference文档:
Analytic functions compute an aggregate value based on a group of rows. They differ from aggregate functions in that they return multiple rows for each group.