Re: [PHP] Compare 2 resultsets of db-query

2002-06-12 Thread Danny Kruitbosch
Analysis & Solutions wrote: > On Wed, Jun 12, 2002 at 04:54:30PM +0200, Danny Kruitbosch wrote: > >>Analysis & Solutions wrote: >> >>>Hey Danny: >>> >>>On Mon, Jun 10, 2002 at 10:09:12PM +0200, Danny Kruitbosch wrote: >>> >>> Query1: SELECT FIELD1, COUNT(FIELD2) AS TOTAL from TABLE GROUP BY F

Re: [PHP] Compare 2 resultsets of db-query

2002-06-12 Thread Analysis & Solutions
On Wed, Jun 12, 2002 at 04:54:30PM +0200, Danny Kruitbosch wrote: > Analysis & Solutions wrote: > >Hey Danny: > > > >On Mon, Jun 10, 2002 at 10:09:12PM +0200, Danny Kruitbosch wrote: > > > >>Query1: SELECT FIELD1, COUNT(FIELD2) AS TOTAL from TABLE GROUP BY FIELD1 > >>Query2: SELECT FIELD1, COUNT(F

Re: [PHP] Compare 2 resultsets of db-query

2002-06-12 Thread Danny Kruitbosch
Analysis & Solutions wrote: > Hey Danny: > > On Mon, Jun 10, 2002 at 10:09:12PM +0200, Danny Kruitbosch wrote: > >>Query1: SELECT FIELD1, COUNT(FIELD2) AS TOTAL from TABLE GROUP BY FIELD1 >>Query2: SELECT FIELD1, COUNT(FIELD2) AS SUB from TABLE WHERE FIELD2=1 >>GROUP BY FIELD1 >> >>Now I want t

Re: [PHP] Compare 2 resultsets of db-query

2002-06-10 Thread Analysis & Solutions
Hey Danny: On Mon, Jun 10, 2002 at 10:09:12PM +0200, Danny Kruitbosch wrote: > > Query1: SELECT FIELD1, COUNT(FIELD2) AS TOTAL from TABLE GROUP BY FIELD1 > Query2: SELECT FIELD1, COUNT(FIELD2) AS SUB from TABLE WHERE FIELD2=1 > GROUP BY FIELD1 > > Now I want to print a table that prints the va

RE: [PHP] Compare 2 resultsets of db-query

2002-06-10 Thread Lazor, Ed
What you're asking is considered a UNION. I'm not sure which database you're using, so I can't tell if it supports UNIONs or not. If you're using MySQL, UNIONs are supported in version 4.0-alpha. Another approach is storing the results of both queries in single array and then pulling it from th