SELECT "dateId","userId","Salary" FROM ( SELECT *, (row_number() OVER (ORDER BY "userId","dateId"))%2 AS rn FROM user_table ) sa WHERE sa.rn=1 AND "userId" = 789 AND "Salary" > 0; }/ t L m6 t8 |% d5 z0 I
但每次手表得到新行,查询结果都不一样。 $ ?6 l5 ^# ]$ F+ P' j8 Q我错过了什么吗? 7 k# D5 \/ N6 a0 F + C. H0 N: {8 Y% v解决方案: