Advertisement
AliaksandrLet

Задача 2/13

Oct 24th, 2022 (edited)
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. WITH cte AS (
  2.     SELECT
  3.         stackoverflow.posts.creation_date::date AS date,
  4.         COUNT(stackoverflow.posts.id) AS count
  5.     FROM
  6.         stackoverflow.posts
  7.         INNER JOIN stackoverflow.post_types ON stackoverflow.post_types.id = stackoverflow.posts.post_type_id
  8.     WHERE
  9.         stackoverflow.post_types.type = 'Question'
  10.         AND stackoverflow.posts.creation_date::date BETWEEN '2008-11-01' AND '2008-11-08'
  11.     GROUP BY
  12.         stackoverflow.posts.creation_date::date
  13. )
  14. SELECT
  15.     ROUND(AVG(count), 0)
  16. FROM
  17.     cte
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement