-
I do the following query and I want to get the overall total.
select sum(nw1w2)||' CAA 97' totpas from caa97
where apt='MAN'
union all
select sum(nw1w2)||' CAA 98' totpas from caa98
where apt='MAN'
union all
select sum(nw1w2)||' CAA 99' totpas from caa99
where apt='MAN'
union all
select sum(nw1w2)||' CAA 00' totpas from caa00
where apt='MAN'
union all
select sum(nw1w2)||' CAA 01' totpas from caa01
where apt='MAN'
How do I do this?
-
SELECT sum(totpas) overall
FROM
(
select ' CAA 97' tname, sum(nw1w2) totpas from caa97
where apt='MAN'
union all
select ' CAA 98', sum(nw1w2) from caa98
where apt='MAN'
union all
select ' CAA 99', sum(nw1w2) from caa99
where apt='MAN'
union all
select ' CAA 00', sum(nw1w2) from caa00
where apt='MAN'
union all
select ' CAA 01', sum(nw1w2) from caa01
where apt='MAN'
)
-
Thanks. How can I get the total at the end of the results from each table?
-
I'd do that programmatically.
Since 8.1.6. you can use analytic functions, but I do not know them at all.
Perhaps somebody else ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|