It's getting late on Friday, but couldn't you build a table with all of
the parameter combinations and then just join against that table?

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 26, 2005 4:25 PM
To: mysql@lists.mysql.com
Subject: Union vs OR

I have a table that holds attributes for users. This is the structure:

TABLE properties (
  id int(11) NOT NULL,
  userid int(11) NOT NULL,
  attrType int(11) NOT NULL,
  attrValue text NOT NULL,
  FULLTEXT KEY propValue (propValue)
) TYPE=MyISAM;

The table is used to find people based on criteria.

A simple query:

select
    userID, attrType, attrValue from properties
where
    propType = 1
and
    propValue= 'some value'

The problem I'm running into is that the number of attributes could be
over
50.

Would a query with many sets of

(propType = 1 and propValue= 'some value')
or
(propType = 2 and propValue= 'some other value')
or ...

work better than doing the same thing with unions?

Or does anyone have an alternate solution?

Thanks for any help!

-- Avi



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to