有人可以帮我在标准中编写以下查询吗?我不知道如何进行子选择。
select * from modulo m
left outer join grupomodulo gm on m.grupomodulo_id = gm.Id
left outer join grupousuariomodulos gum on gum.modulo_id = m.Id
left outer join grupousuario gu on gum.grupousuario_id = gu.Id
where exists
(
select Id from
(
select distinct(sm.Id), sm.nome from modulo sm
left outer join grupomodulo sgm on sm.grupomodulo_id = sgm.Id
left outer join grupousuariomodulos sgum on sgum.modulo_id = sm.Id
left outer join grupousuario sgu on sgum.grupousuario_id = sgu.Id
order by sm.Nome
limit 10 offset 10
)
as subquery
where Id = m.Id
)
order by m.Nome