解答
179
SQL文(クエリ)
WITH master AS ( SELECT cid , session_count , MAX(cv_page) AS cv FROM ( SELECT * , IF(page = "/thank_you/", 1, 0) AS cv_page FROM sample.web_log ) GROUP BY cid , session_count ) SELECT SUM(cv) AS cv , COUNT(*) AS session , ROUND(SUM(cv) / COUNT(*), 4) AS cvr FROM master