At 03:24 16/12/99 -0700, Michael wrote:
>I figure there must be a way to compare two data sets with the MySQL
functions I just havn't been able to figure it out. For example;
>
>Set 1: ('Adam','Mary','Michael','Amy')
>Set 2: ('Susan','Adam','Michael')
>
>These are not separate tables! Assume Set 1 would be just one record of a
DB table with a different set on each row on the server. Set2 is known only
to the client. I'd like to do something like
>
>SELECT count(elements in interesection(set1,('Susan','Adam','Michael')))
>FROM ...
>WHERE ...
>
>Would one of the SET or Bit functions (or combination) allow me to compare
these two sets and somehow determine the intersection. For example there
are 2 common elements between the two sets, 'Adam' and 'Michael'. Actually,
it's more important for my application that I know there is exactly 2
matches than to specify which two elements those 2 matches represent. Any
ideas?
>
This is a bit off topic; its not even a question about SQL.
MySQL is a relational database - what you propose does not conform to the
rules of normalization (breaks 1 & 2 I think).
Find a book on relational database design - see the archive.
Colin