from c in City,
left_join: p in Post,
on: p.id == c.post_id,
select: [c.name, p.title],
preload: [:post]
For the csv lib i need the table data in a two dimensional list. The obove gives me: the binding used in from must be selected in select when using preload in query
You can remove the preload and it should work with just the join that you have. Preload attaches the preloaded data to the source schema and since you are not selecting the source schema (only a single field from it) it is not needed.
Thank you. Would there be a way with the existing query? I´ve a big complex query with preload. Now i´d like to only use some fields for exporting to a csv.