Reply to Re: SQL script - sum total issue

Your name:

Reply:


Posted by Jeffrey S via SQLMonster.com on 09/10/05 00:26

Lightbulb...thanks for the help...toggling between SQL and Cognos I forgot
the most obvious...

Erland Sommarskog wrote:
>> I have this script...I would like to group the total of project_amt_1
>> (July) by the project_id and the same for the 11 months and the total.
>
>It is unclear to me what you want. If all you want is the sum per
>project and no information per component and cost_element, then
>you can say:
>
> select a.project_id, SUM(a.project_amt_1) as 'July',
> SUM(a.project_amt_2) as 'August'
> ...
> from component_monetary_balance as a, project as b, component as c
> ...
> and project_ytd_amt <> 0
> GROUP BY a.project_id
>
>If this does not answer you question, could you please clarify with
>an example?
>
>--
>Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
>Books Online for SQL Server SP3 at
>http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp


--
Message posted via http://www.sqlmonster.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация