with max_comment_dates as ( select postid, max(creationda...

0

Please login or register to vote for this query.

(click on this box to dismiss)

English Language Learners

Q&A for speakers of other languages learning English

with max_comment_dates as (
    select postid, max(creationdate) as max_creationdate
    from comments
    where text is not null
    group by postid
),
latest_comments as (
    select top 10 c.postid, c.text as latest_comment
    from comments c
    join max_comment_dates mcd on c.postid = mcd.postid and c.creationdate = mcd.max_creationdate
    where c.text is not null and c.postid in (75632691, 76079476, 28645383)
)
select * from latest_comments;


-- 75632691
-- 76079476
-- 28645383

Enter Parameters

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