select
    c.*,
    a.title as listing_a_title,
    b.title as listing_b_title,
    w.title as winner_title
from {{ elo_schema }}.comparisons as c
left join {{ listings_schema }}.{{ listings_table }} as a
    on c.listing_a_id = a.global_id
left join {{ listings_schema }}.{{ listings_table }} as b
    on c.listing_b_id = b.global_id
left join {{ listings_schema }}.{{ listings_table }} as w
    on c.winner_id = w.global_id
order by c.created_at desc
limit :limit
