postgres: add table alias to query

This commit is contained in:
Maximilian Keßler 2023-12-24 23:39:34 +01:00
parent 8e1b84467b
commit c525f80fe9
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -460,14 +460,14 @@ def get_player_list() -> List[Dict]:
" WHERE user_ratings.user_id = users.id AND user_ratings.rating_type = 0"
" ORDER BY league_id DESC"
" LIMIT 1"
" ) ON TRUE "
" ) AS nv_rating_table ON TRUE "
" LEFT JOIN LATERAL ("
" SELECT value_after AS cs_rating"
" FROM user_ratings"
" WHERE user_ratings.user_id = users.id AND user_ratings.rating_type = 1"
" ORDER BY league_id DESC"
" LIMIT 1"
" ) ON TRUE "
" ) AS cs_rating_table ON TRUE "
")"
"SELECT"
" player_name AS name,"