If I have a table with a set such as this:

CREATE TABLE application (
  application_num int(6) NOT NULL auto_increment,
  availability set('weekdays','weekends','mornings','afternoons')
default NULL, PRIMARY KEY (application_num)
) TYPE=MyISAM;

is it possible to search based on members of the set?  

For example, someone might have selected ('weekends,mornings')
for their entry in this set, and I am interested in searching
for people who are available in the morning.  However running a 
query such as:

mysql> select * from application where availability = 'mornings';

would not return a person who is available for both weekends and 
mornings, since there set entry would be 'weekends,mornings'.  

Writing querys to try to cover all the posibilities such as:

mysql> select * from application where availability = 'mornings' or 
availability = 'weekends,mornings' or ... ;

Seems like the wrong thing to do.  Anyone have any ideas?  I wouldn't 
be using sets if I could, but I am stuck with them for this prjoect.  

Thanks a lot,

  John



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to