I am trying to display the string "Total", which will do the sum of the Count column. The following code will contain two columns: "Environment and quantity."
select
case
when env is null THEN 'Unknown'
else env
end,
count(*) as Count
from env_table
group by env
order by env
/
The conclusion I would like:
Windows 200
Linux 120
Total 320
As you can see above, what I would like to do is add a line called “Total” at the end, which essentially will do SUM (count (*)). What is the correct syntax for this? Thank!
source
share