SQL window function

SQL

https://www.codewars.com/kata/589cf45835f99b2909000115/train/sql

SELECT 
  DATE(created_at) date,
  COUNT(created_at) count,
  SUM(COUNT(created_at)) OVER (ORDER BY DATE(created_at) ASC ) :: INTEGER total
FROM posts
GROUP BY date
ORDER BY date

/*window_function ( column )
OVER ( [ PARTITION BY partition_list ] [ ORDER BY order_list] )*/
Did you find this snippet useful?

Sign up for free to to add this to your code library

median
SQL

4
SQL RANK
SQL

4
EXISTS
SQL

3