Mailing List Archive



Back to the month index Back to the list index

dennis (dennis@etinc.com)
Sun, 1 Sep 1996 15:57:23 -0400


Date: Sun, 1 Sep 1996 15:57:23 -0400
Message-Id: <199609011957.PAA12273@etinc.com>
From: dennis@etinc.com (dennis)
Subject: [mSQL] Multiple ORs - Possible?

Without parenthesis, it seems impossible to do a query with multiple
ORs. Am I correct?

For example, if I needed to get all of the men who live in either
Moosebreath or Bumfuk who drive either toyota or fords, how would
it be done?

ie

SELECT * from Database WHERE
        SEX = "M" AND
        CITY = "Moosebreath" OR CITY = "BUMFUK" AND
        CAR = "Toyota" OR CAR = "Ford"

The above pulls anyone who drive a ford, which is clearly wrong.

moving one of the OR clauses to the beginning will make one work,
but you cant AND two ORs...ie

SELECT * from Database WHERE
        CITY = "Moosebreath" OR CITY = "BUMFUK" AND
        CAR = "Toyota" OR CAR = "Ford"

doesn't work.

How would you do this? Surely at this point in the products evolution
this problem has been solved.

Dennis

        

--------------------------------------------------------------------------
To remove yourself from the Mini SQL mailing list send a message containing
"unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com. Send a message containing
"info msql-list" to majordomo@bunyip.com for info on monthly archives of
the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!