Limit join to one row

Is it possible to limit a join to a single row without going for a full SQL query?

e.g. select blog posts joined with most recent comment.

something like

select * from posts join (
    select distinct on (post_id) * from comments  order by post_id, created_at desc
) as latest_comments
on posts.id = lastest_comments.post_id

Thanks : )

Hi @tslocke
Only by creating a question, which returns the latest comments in a separate question. Or using Models.
https://www.metabase.com/docs/latest/users-guide/04-asking-questions.html#picking-data
https://www.metabase.com/docs/latest/users-guide/models.html

1 Like