Could this query also be:
select * from orders
inner join reports
on orders.id = reports.order_id
It looks like you want to select all of the orders
that are in reports
. I think an inner join can do the same without a subquery.
from o in Order,
join: r in Report,
on: o.id == r.order_id