Implements full player get
This commit is contained in:
22
backend/selectNotes.sql
Normal file
22
backend/selectNotes.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
-- 2. Get N most recent notes (10 rows)
|
||||
select
|
||||
id as NoteID,
|
||||
content as NoteContent,
|
||||
timestamp as NoteTimestamp
|
||||
from
|
||||
(
|
||||
select
|
||||
n.*,
|
||||
ROW_NUMBER() OVER (
|
||||
order by
|
||||
timestamp desc
|
||||
) as rn
|
||||
from
|
||||
note n
|
||||
where
|
||||
n.player = $1
|
||||
) ranked
|
||||
where
|
||||
rn <= $2
|
||||
order by
|
||||
timestamp desc;
|
Reference in New Issue
Block a user