I need insert some information of a table in another table.
Is possible to do something like this code (that doesn’ t work) to execute only one query and not 2 separately?
Thanks
followers = from u in User,
select: %{user_id: u.id, topic_id: ^topic.id},
inner_join: a in Activity, on: [user_id: u.id],
where: a.contest_id == ^topic.contest_id
and a.type == 1
Repo.insert_all(TopicUser, followers)