解答

181

SQL文(クエリ)

WITH master AS (
  SELECT
    cid
    , session_count
    , COUNT(*) AS pv
  FROM
    sample.web_log
  GROUP BY
    cid
    , session_count
)
SELECT
  ROUND(bounce / sessions, 2) AS bounce_rate
FROM
  (
    SELECT
      (
        SELECT
          COUNT(*)
        FROM
          master
        WHERE
          pv = 1
      ) AS bounce
      , (
        SELECT
          COUNT(*)
        FROM
          master
      ) AS sessions
  )

結果テーブル

結果テーブル

サポートページに戻る