Silly question I suspose but when developing queries specific for reporting (i.e. read only, multiple table joins, etc.) what is the prefered way of writing the models and controllers? Example (simple sql): SELECT users.id, users.name, ISNULL(SUM(ticketIncidents.totaltime), 0) AS totalTime, COUNT(ticketIncidents.totaltime) AS totalIncidents FROM users LEFT OUTER JOIN ticketIncidents ON users.id = ticketIncidents.assignedby_id GROUP BY users.id, users.name ORDER BY users.name The above sql is pretty simple but what happen when the sql gets complicated? Oracle has PL/SQL and MSSQL has Transact-SQL which add the ability to add procedural elements to the sql. Any thoughts? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---