【发布时间】:2013-03-15 14:31:40
【问题描述】:
我将如何进行以下查询:
OrderNotes.objects.filter(item=item).distinct('shared_note')
基本上,我需要获取所有 OrderNotes 项目,在 shared_note 上不同。当我尝试这样做时,我得到:
raise NotImplementedError('DISTINCT ON fields is not supported by this database backend')
NotImplementedError: DISTINCT ON fields is not supported by this database backend
我正在使用 mysql,无法在此处更改数据库。 django 中的解决方法是什么?
【问题讨论】: