Py学习  »  问与答

django的group by,好烦

juma • 9 年前 • 3813 次点击  

找了一圈group by的东西。没有解决我的需求: 问题: select id,max(price) ,groupid from table where vote>1 group by groupid 如果使用 .objects.filter(条件).value(price).annatate(max(price)) 的方法, 那么id 和 groupid 这两个字段,无法显示。 有什么好的方法么?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/1238
 
3813 次点击  
文章 [ 1 ]  |  最新文章 9 年前