RE: [PHP-DB] help with complex query

From: Date: Mon, 12 Nov 2001 01:25:07 +0000
Subject: RE: [PHP-DB] help with complex query
Groups: php.db 
Request: Send a blank email to php-db+get-14238@lists.php.net to get a copy of this message
I'd think something like: select type, version, sum(hitcount) as count from blah where blah group by type, version order by count would do the trick... -Lorenzo -----Original Message----- From: Noah Spitzer-Williams Sent: Sun 11/11/2001 7:51 PM To: php-db@lists.php.net Cc: Subject: [PHP-DB] help with complex query hey guys, ok i have a table that looks somethign like this: 1 | js | 1.3 | 10 1 | js | 1.3 | 5 1 | js | 1.2 | 3 2 | browser | ie5 | 17 lets say the first column refers to a web site's id and the two middle columns are stats about the site. the last column is how many times that stat occured. for example, site 2 had 17 visitors using the ie5 browser. what i want to do is make a 'global stats' page that combines all of the stats. it would read: js | 1.3 | 15 js | 1.2 | 3 browser | ie5 | 17 noticed how it combined the two js 1.3 columns i've tried grouping and many other things i just cant figure out how to do it. any help is appreciated! - Noah www.trademytraffic.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#14238) next »