> That is not the case on MySQL and PostgreSQL for. example.
+1 Insightful.
I'm still trying to get my Ops guys to let us drop and re-create databases
for Postgres/MySQL. They are very afraid to give that permission because
they worry about production databases, and it is hard for them to mana
Dan,
The root of the issue here is that you query is asking to retrieve all
fields from
the Parent table and perform an aggregation on the JOIN'ed child table.
That results in the following query
SELECT parent.*, MAX(child.updated_timestamp)
FROM parent
JOIN child ON (child.parent_id = parent.i
Looks like there is no problem here. Django groups by whatever is in the
query, so that this would be done as follows:
Parent.objects.values('id').annotate(child_updated_timestamp=models.Max('child_updated_timestamp'))
On Monday, November 26, 2018 at 12:32:09 PM UTC-5, Dan Davis wrote:
>
> I
3 matches
Mail list logo