Welcome Guest, Not a member yet? Register   Sign In
Combining AND & OR in MySQL Queries
#1

[eluser]sideshowbob[/eluser]
Hi Everyone,

I have what I thought was a simple question but I'm struggling to find the answer...

Within CI how do I create a query that produces the following :

Code:
SELECT * FROM Persons WHERE
LastName='Svendson'
AND (FirstName='Tove' OR FirstName='Ola')

There can be many LastNames and Firstnames.

I can create the query easily without the brackets but then it is not the same query.

Thanks!
Bob


Messages In This Thread
Combining AND & OR in MySQL Queries - by El Forum - 10-03-2008, 07:58 AM
Combining AND & OR in MySQL Queries - by El Forum - 10-03-2008, 08:41 AM
Combining AND & OR in MySQL Queries - by El Forum - 10-03-2008, 08:52 AM
Combining AND & OR in MySQL Queries - by El Forum - 10-03-2008, 10:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB