![]() |
|
Archives of the TeradataForumMessage Posted: Wed, 07 Nov 2007 @ 19:39:09 GMT
Oscar This can be achieved by the use of derived tables as below:
**
*SELECT* A1.OFFICE, SUM(A1.HOURS) *AS* HOURS
, SUM(A1.HOURS) / A2.totalhours *AS* HRSPCT
**
*FROM* *TABLE* *AS* A1
, (*select* sum(hours) *from* *table*) a2 (totalhours)
**
*WHERE* A1.OFFICE *LIKE* 'AD%'
**
*GROUP* *BY* A1.OFFICE;
Good luck, Frank
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||