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 optimzed

AW: [PHP-DB] SQL Select statement

2001-02-16 Thread Matthias Kopolt
try something like: select a.memberID from table a, table b where a.choice=2 and b.choice=3 and a.memberID = b.memberID; or select memberID, count(*) from table where choice=2 or choice=3 group by memberID having count(*) = 2; (i don't know what is more effizient, might depend on your indexes