+------------+-----------+-------------------+-------------+----------------------------+----------------+----------------------------------+ | n | n_parse | pct_n_parse_of_n | n_parse_mf | pct_n_parse_mf_of_n_parse | n_parse_mf_ni | pct_n_parse_mf_ni_of_n_parse_mf | +------------+-----------+-------------------+-------------+----------------------------+----------------+----------------------------------+ | 656646289 | 33701182 | 5.1323 | 613343 | 1.8199 | 74684 | 12.1765 | +------------+-----------+-------------------+-------------+----------------------------+----------------+----------------------------------+ select n, n_parse, round(100 * n_parse / n, 4) as pct_n_parse_of_n, n_parse_mf, round(100 * n_parse_mf / n_parse, 4) as pct_n_parse_mf_of_n_parse, n_parse_mf_ni, round(100 * n_parse_mf_ni / n_parse_mf, 4) as pct_n_parse_mf_ni_of_n_parse_mf from ( select count(*) as n, count(if(uri_query like '%action=parse%', 1, null)) as n_parse, count(if(uri_query like '%action=parse%' and uri_query like '%mobileformat%', 1, null)) as n_parse_mf, count(if(uri_query like '%action=parse%' and uri_query like '%mobileformat%' and uri_query like '%noimages%', 1, null)) as n_parse_mf_ni from wmf.webrequest where year = 2018 and month = 11 and day = 28 and uri_path = '/w/api.php' ) as numbers ;