postgres查询某条数据的排名
select * from (select ROW_NUMBER () OVER (ORDER BY fat desc nulls last) AS xuhao,foodnum,foodname,fat from ek_food where isdel=0) food where foodnum = 'Ss192008'
涉及到的问题
1.排序时,字段值为null的会排在前面,导致数据不准确...
原创
2018-12-14 11:13:51 ·
1686 阅读 ·
0 评论