Here's the request:
select
(
SELECT COUNT(*)
FROM Sending s
WHERE (ConfID = 1) AND (Status = 1)
)
/
(
(
SELECT COUNT(*)
FROM Numbers
WHERE (ConfID = 1)
)
/
100
)
I want to calculate interest. For example, if the request
SELECT COUNT(*)
FROM Numbers
WHERE (ConfID = 1)
gives 100 and the other
SELECT COUNT(*)
FROM Sending s
WHERE (ConfID = 1) AND (Status = 1)
Results 50 of the query result should return 50, which means 50%. But the first query results with 2 and the second returns 10000, the query result returns 0. I think I should somehow determine the number of a floating point or so on.
Thank!
kseen source
share