Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

postgresql division count return 0

-- generally it happens because count is integer 
-- and division in count rounds the number to 0
-- my solution was to convert to float. Ex
select count(*)::float/sum(*)::float
....
 
PREVIOUS NEXT
Tagged: #postgresql #division #count #return
ADD COMMENT
Topic
Name
5+7 =