Hi,

I have a fairly complex SQL statement I'd like to convert to AREL

SELECT count(matches.id), players.*
FROM clubs
INNER JOIN players ON players.club_id = clubs.id
INNER JOIN rankings ON rankings.player_id = players.id
INNER JOIN tournaments ON rankings.tournament_id = tournaments.id
LEFT OUTER JOIN matches ON (matches.p1_id = players.id OR
matches.p2_id = players.id)
AND clubs.id = 7
AND tournaments.id = 19
GROUP BY players.id

How would I do this?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to