回答編集履歴

2

見直し

2017/04/05 10:39

投稿

退会済みユーザー
test CHANGED
@@ -1,5 +1,3 @@
1
- ORDER BYで降順に並べ替える。
2
-
3
1
  rank()を使って日付降順の並びに順位をつける。
4
2
 
5
3
  それをサブクエリーに書いて、ランクの数字で制限する。

1

加筆修正

2017/04/05 10:39

投稿

退会済みユーザー
test CHANGED
@@ -7,3 +7,11 @@
7
7
 
8
8
 
9
9
  [Window関数 | Let's Postgres](http://lets.postgresql.jp/documents/technical/window_functions)
10
+
11
+ [PostgreSQLウィンドウ関数のTips | インフラ・ミドルウェア | POSTD](http://postd.cc/window_functions_postgresql/)
12
+
13
+ [PostgreSQLの分析関数の衝撃6 (window関数の応用例) (1/4):CodeZine(コードジン)](http://codezine.jp/article/detail/4747)
14
+
15
+ [PostgreSQLの分析関数の衝撃(7) ――window関数の変わった使用例 (1/4):CodeZine(コードジン)](http://codezine.jp/article/detail/4790)
16
+
17
+