I have this situation:
SELECT uf.*, SUM(uto.points) AS total_points_live,
SUM(utl.points) AS total_points_online,
(total_points_live + total_points_online) AS total_points
FROM users AS uf
LEFT JOIN users_tourney_online AS uto
ON uto.id_users = uf.id
LEFT JOIN users_tourney_live AS utl
ON utl.id_users = uf.id
GROUP BY uf.id ORDER BY total_points DESC
But not working because aliases cannot be used.
Can you help me?
Regards,