> I want to find out which memberIDs have BOTH choice 2 AND choice 3.
>
> --> SELECT memberID from table where choice=2 AND choice = 3
>
> That won't work (0 results, of course, because no row has two choices,
> they're mutually exclusive)
>
Exactly, keep several rows for choices,
have two tabl
Addressed to: "JJeffman" <[EMAIL PROTECTED]>
"PHPDB" <[EMAIL PROTECTED]>
"bill" <[EMAIL PROTECTED]>
** Reply to note from "JJeffman" <[EMAIL PROTECTED]> Sat, 17 Feb 2001 13:11:20
-0300
>
> Try this way :
>
> "select t1.memberID,t1.choice,t2.memberID, t2.choice from ta
>think you can give your problem another approach, splitting it in two
>queries and joining the result sets through php script.
>Sometimes you can't put SQL to do all the work.
That's true, but in most cases it is more efficient to leave the joins,
orders etc. in the DB, because its more optimze
PROTECTED]>
Enviada em: sexta-feira, 16 de fevereiro de 2001 22:44
Assunto: [PHP-DB] SQL Select statement
> I have a table with three simple columns: id(unique), memberID, and
> choice
>
>
> I want to find out which memberIDs have BOTH choice 2 AND choice 3.
>
> --> SELECT me
dexes and the
amount. the second sql asumes you only have one row per memberID - choice
(noone should choose 3 2times ore more)
mk
-Ursprungliche Nachricht-
Von: bill [mailto:[EMAIL PROTECTED]]
Gesendet: Samstag, 17. Februar 2001 02:45
An: [EMAIL PROTECTED]
Betreff: [PHP-DB] SQL S
I have a table with three simple columns: id(unique), memberID, and
choice
I want to find out which memberIDs have BOTH choice 2 AND choice 3.
--> SELECT memberID from table where choice=2 AND choice = 3
That won't work (0 results, of course, because no row has two choices,
they're mutually ex