A little bit of ConnectWise SQL converted to AREL, https://github.com/rails/arel. Took me a while to work out how to do the left joins, be we got there. To me it would be nice to have a 'outer_join' or 'join_outer' method which does 'join(x, Arel::Nodes::OuterJoin)'.
A little bit of ConnectWise SQL converted to AREL, https://github.com/rails/arel. Took me a while to work out how to do the left joins, be we got there. To me it would be nice to have a 'outer_join' or 'join_outer' method which does 'join(x, Arel::Nodes::OuterJoin)'.
select * from config c join cs_survey s ON s.cs_survey_recid = c.cs_survey_recid join company ON c.company_recid = company.company_recid left join agr_config on agr_config.config_recid = c.config_recid