Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

SQL sum column resulting from query

SELECT SUM(a.suma) from 
    (SELECT (CASE
        WHEN sum(cantidad) > 0 THEN 1
        WHEN sum(cantidad) <= 0 THEN 0
        END) AS suma FROM volcado GROUP BY reserva)a
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #SQL #sum #column #resulting #query
ADD COMMENT
Topic
Name
4+5 =