I know this question has been asked before but I've been trying the solutions and I'm still getting errors.
I've created a view to view the quantity of life jackets by size:
---------------LIFE JACKET LIST------------
CREATE VIEW Life_Jacket_List AS
SELECT size,SUM(quantity) AS Quantity
FROM life_jackets LEFT JOIN equipment USING(model)
GROUP BY size with ROLLUP
Which looks like this:
size | Quantity |
L | 48 |
M | 39 |
S | 35 |
NULL | 122 |
Basically I just want to change the "null" to "Total". Here is what I've done so far:
CREATE VIEW Life_Jacket_List AS
SELECT size, size = ISNULL(size, ‘Total’), TotalLife = SUM(quantity), SUM(quantity AS Quantity
FROM life_jackets LEFT JOIN equipment USING(model)
GROUP BY size with ROLLUP
I'm getting an error though:
1582 - Incorrect parameter count in the call to native function 'ISNULL'
Any idea on how to fix this?