|
|
Archives of the TeradataForum
Message Posted: Tue, 06 Nov 2007 @ 23:29:05 GMT
Subj: | | Re: Calculate Percentages for a column |
|
From: | | Michael Larkins |
Oscar:
You cannot put a SELECT in a SELECT. It can however be in the FROM. Try something like this:
> SELECT A1.OFFICE, SUM(A1.HOURS) AS HOURS, (SUM(A1.HOURS) / tot_hrs as hrspct
> FROM TABLE AS A1, (SELECT
> SUM(HOURS) FROM TABLE) dt (tot_hrs)
> WHERE A1.OFFICE LIKE 'AD%'
> GROUP BY A1.OFFICE;
Hope this helps,
Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor
| |