Re: [PHP-DB] SQL Select statement

2001-02-19 Thread Lennin Arriola
> 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

Re: [PHP-DB] SQL Select statement

2001-02-17 Thread php3
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

AW: [PHP-DB] SQL Select statement

2001-02-17 Thread Matthias Kopolt
>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

Re: [PHP-DB] SQL Select statement

2001-02-17 Thread JJeffman
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

AW: [PHP-DB] SQL Select statement

2001-02-16 Thread Matthias Kopolt
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

[PHP-DB] SQL Select statement

2001-02-16 Thread bill
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