How can i use OR for conditioning in join using query builder?

You can’t.

Start with Subscription, then add User joining on PrimaryUserID Left join

Then add User a 2nd time, this time joining on UsedByUserID Left join

Custom column(s) to create a single user.

Then some group by to remove any duplicates.

Alternatively, create a model from a SQL question.

1 Like