Sobes.tech
Senior
37

Escribe una consulta SQL para encontrar el video más largo entre los 10 videos más cortos de la tabla video (id, duración, id del autor). with sbq as ( select id, duration, author_id from video order by duration limit 10 ) select id, duration, author_id from sbq order by duration DESC limit 1 select id, duration, author_id from video order by duration limit 1 offset 9 shortest = Video.objects.order_by('duration').values('id')[:10][-1] result = Video.objects.filter(id__in=Subquery(shortest)).order_by("-duration").first()

Empresas donde se preguntó
Руформ Тех