解答

185

SQL文(クエリ)

WITH master AS (
  SELECT
    cid
    , session_count
    , device
    , 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
    , device
)
SELECT
  device
  , SUM(cv) AS cv
  , COUNT(*) AS session
  , round(SUM(cv) / COUNT(*), 4) AS cvr
FROM
  master
GROUP BY
  device

結果テーブル

結果テーブル

サポートページに戻る