Welcome Guest, Not a member yet? Register   Sign In
Group where statements together with active record
#1

[eluser]simshaun[/eluser]
I had a situation come up the other day where I needed to group a couple where statements together. Typically I use Active Record for all my database stuff, but I ended up hardcoding that specific SQL statement.

Is there a way to group where statements together with Active Record where the SQL generated is something along the lines of
Code:
SELECT
    id
FROM
    users
WHERE
    (first_name = 'John' AND age = 30)
        OR
    (first_name = 'John' AND height = 'tall')
        OR
    first_name = 'Bob'


Messages In This Thread
Group where statements together with active record - by El Forum - 06-24-2009, 02:46 PM
Group where statements together with active record - by El Forum - 06-24-2009, 07:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB