feat: separate sql
This commit is contained in:
14
backend/app/sql/history.sql
Normal file
14
backend/app/sql/history.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
Reference in New Issue
Block a user