View Single Post
  #2 (permalink)  
Old 12-01-2006, 04:17 AM
ben ben is offline
Administrator
 
Join Date: Mar 2007
Posts: 87
ben has disabled reputation
Default SQL 92 answer. Re: How to perform aggregation (sum) on a computed column?

There are several ways you could try this. The easisest however (but probably not the most efficient) is to use a subquery.

[sql]
SELECT
(AGE * 10) AS XYZ,
(SELECT SUM(AGE * 10) FROM MY_TABLE ) as XYZ_SUM
FROM MY_TABLE
[/sql]
Reply With Quote