MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Nils Valentin Date:July 24 2003 3:07am
Subject:Re: HELP WITH mySQL!!!
View as plain text  
Hi Michael,

I a not 100% sure if I understood you correctly, but what you want to do seems 
to be better made in the application itself, rather then the SQL code.

However you can use ALIASES together with the GROUP BY function and specify 2 
columns (Cars and COUNT(Monthofyear) which should list the items sperarately, 
but the formatting will still need to be made with your application.

Best regards

Nils Valentin
Tokyo/Japan


2003年 7月 24日 木曜日 04:47、Michael C. Podlesny さんは書きました:
> UGHH HELP!!
>
> I need to write a sql statement that will take the data from my table and
> use it as column headers.  For example,
>
> If I have a field named GoLiveDate and a field called Qty and a field
> called Cars:
>
> Cars  |  Qty  |  GoLiveDate
> ==================
> CarA |  5     |  7/21/2003
> CarA | 10    |  7/28/2003
> CarA | 14    |  8/1/2003
> CarB |  2     |  7/21/2003
> CarB | 3    |  7/28/2003
> CarB | 4    |  8/1/2003
> CarC |  7     |  7/21/2003
> CarC | 19    |  8/28/2003
> CarC |  44    |  9/1/2003
>
> The results should be
>
> Cars        July        August        September
> ==============================
> CarA        15            14                0
> CarB        5                4                0
> CarC        7                19            44
>
>
> Any help that you could give or point me to where I can find a solution
> would help.  I am getting stuck on making the Month name's of the dates the
> column headers
>
>
> Thanks,
> Mike

-- 
---
Valentin Nils
Internet Technology

 E-Mail: nils@stripped
 URL: http://www.knowd.co.jp
 Personal URL: http://www.knowd.co.jp/staff/nils

Thread
mysql stops processingJoe Shear23 Jul
RE: mysql stops processingAndrew Braithwaite23 Jul
  • RE: mysql stops processingJoe Shear23 Jul
  • HELP WITH mySQL!!!Michael C. Podlesny23 Jul
    • Re: HELP WITH mySQL!!!Nils Valentin24 Jul
Re: mysql stops processingHeikki Tuuri23 Jul
  • Re: mysql stops processingJoe Shear23 Jul
Re: mysql stops processingHeikki Tuuri23 Jul
  • Re: mysql stops processingJoe Shear23 Jul
RE: mysql stops processingAndrew Braithwaite23 Jul
Re: mysql stops processingHeikki Tuuri23 Jul
Re: mysql stops processingHeikki Tuuri24 Jul
  • Re: mysql stops processingJoe Shear24 Jul
Re: mysql stops processingHeikki Tuuri24 Jul
Re: mysql stops processingInfo26 Jul
Re: mysql stops processingInfo26 Jul