db2 语句

取前几条数据,日期降序(取客户编号为420302100006,最近日期3条数据)

SELECT clientcode,yearmonth,contribution,totalscore,rownumber()
over(order by yearMonth desc) as rn  FROM JINYE_CONTRIBUTION where clientcode='420302100006' FETCH FIRST 3 ROWS ONLY

你可能感兴趣的:(db2 语句)