解答

183

SQL文(クエリ)

WITH master AS (
  SELECT
    cid
    , session_count
    , COUNT(*) AS pv
  FROM
    sample.web_log
  GROUP BY
    cid
    , session_count
)
SELECT
  ROUND(pageviews / sessions, 1) AS pv_per_session
FROM
  (
    SELECT
      (
        SELECT
          SUM(pv) AS pageviews
        FROM
          master
      ) AS pageviews
      , (
        SELECT
          COUNT(*)
        FROM
          master
      ) AS sessions
  )

結果テーブル

結果テーブル

サポートページに戻る