sql ROLLUP
-
I am using ROLLUP build in function SELECT Product,COUNT(Total), FROM myTable Group BY TOTAL with ROLLUP Percent - is calculated %. when I run it for product I am getting NULL in ROLLUP row. How to I replace with word? so it looks like this TOTAL 23 100 instead of NULL 23 100
-
I am using ROLLUP build in function SELECT Product,COUNT(Total), FROM myTable Group BY TOTAL with ROLLUP Percent - is calculated %. when I run it for product I am getting NULL in ROLLUP row. How to I replace with word? so it looks like this TOTAL 23 100 instead of NULL 23 100
SELECT
case when (Grouping(Product) = 1) then 'Total'
else Product
end Product,
COUNT(Product) as Counter
FROM myTable
Group BY Product with ROLLUP"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
-
SELECT
case when (Grouping(Product) = 1) then 'Total'
else Product
end Product,
COUNT(Product) as Counter
FROM myTable
Group BY Product with ROLLUP"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
Well I'll be buggered, I did not know the keyword rollup, thank you have 5.
Never underestimate the power of human stupidity RAH
-
Well I'll be buggered, I did not know the keyword rollup, thank you have 5.
Never underestimate the power of human stupidity RAH
I'll take the 5, thank you, but pass on the buggery, if you don't mind. :-)
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me