Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

pgsql sum switch case

SELECT 
SUM(
    CASE 
      WHEN condition_1  THEN result_1
      WHEN condition_2  THEN result_2
      [WHEN ...]
      [ELSE else_result]
	END
)
FROM ...
Source by www.postgresqltutorial.com #
 
PREVIOUS NEXT
Tagged: #pgsql #sum #switch #case
ADD COMMENT
Topic
Name
4+2 =