N
N
number12018-04-16 08:48:14
MySQL
number1, 2018-04-16 08:48:14

How to split subqueries?

There is a table . It is
necessary to count the number of records under two different conditions and divide the result of one subquery into another.
How to do this in mysql with one query?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Entelis, 2018-04-16
@number1

select 
   (SELECT count(*) FROM `....` WHERE ...) / (SELECT count(*) FROM `...` WHERE ...) as rate

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question