Answer the question
In order to leave comments, you need to log in
Need help with a CASE query?
Hello, guys, who will tell you how to write such a request that considered the conversion,
for example, there is a field ID, STATUS
STATUS has the following values 1,2,3,4,5
1 - this is a successful status
!= 1 all unsuccessful
, here's how I can calculate the conversion using CASE help plz because i ended up with this
SELECT
COUNT(*)FILTER(WHERE STATUS = 1) SUCCESS,
COUNT(*)FILTER(WHERE STATUS != 1) UNSUCCESS,
FROM TABLE
The arithmetic is:
success / (success+fail) * 100
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question