I have a table full of cell phone data with three important columns:  
ServiceNumber, ratingPeriod (1,2 or 3) and minutes. I want to run a 
query grouped by serviceNumber that gives me the sum of minutes per 
rating period for each of the numbers in the other cloumns. So the query 
result will look like this:

serviceNumber | SUM(of minutes where ratingPeriod =1) | SUM(of minutes 
where ratingPeriod =2) | SUM(of minutes where ratingPeriod =3)

I was able to do this with other tools using "Transform" and "Pivot" 
commands which are not present in MySQL.

Is this particular query possible in MySQL? If it is not possible with a 
query perhaps it would be possible to build a table in memory and add 
the three columns to it individually?

TIA,
Dan


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to