test

0

Please login or register to vote for this query.

(click on this box to dismiss)

Lifehacks

Q&A for people looking to bypass life's everyday problems with simple tricks

with ParentIDRank AS
(select id, parentid, row_number() OVER (partition by parentid order by id desc) AS ParentIDRowNumber 
from posts where parentid is not null)
Select * from ParentIDRank where ParentIDRowNumber = 1
order by parentid asc, parentidrownumber asc

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results