I have a MySQL query that ran fine but my hosting proivder change my database to MariaDB. The query in itself works fine but I can't get the sorting to work correctly as it did in MySQL.
Is there some syntax that has changed or is it not available anymore?
SELECT
id,
name,
position,
player1,
player1_thru,
player1_to_par,
player2,
player2_thru,
player2_to_par,
player3,
player3_thru,
player3_to_par,
team_total,
IF (counter = 1, @rank:= placeholder, @rank) AS ranker
FROM(
SELECT
*,
@c := @c +1 AS placeholder,
IF(@a <> team_total, @b := @b := 1, @b :=0) AS counter,
@a := team_total
from(
SELECT
usopen_2018.id,
usopen_2018.position
, usopen_2018.name
, usopen_2018.player1
, player1_score.hole as player1_thru
, player1_score.to_par_s AS player1_to_par
, usopen_2018.player2
, player2_score.hole as player2_thru
, player2_score.to_par_s AS player2_to_par
, usopen_2018.player3
, player3_score.hole as player3_thru
, player3_score.to_par_s AS player3_to_par
, (player1_score.`to_par` + player2_score.`to_par` + player3_score.`to_par`) AS team_total
FROM usopen_2018
INNER JOIN leaderboard_A AS player1_score
ON player1_score.name = usopen_2018.player1
AND player1_score.tournament_name = 'U.S. Open'
AND player1_score.year = 2018
INNER JOIN leaderboard_A AS player2_score
ON player2_score.name = usopen_2018.player2
AND player2_score.tournament_name = 'U.S. Open'
AND player2_score.year = 2018
INNER JOIN leaderboard_A AS player3_score
ON player3_score.name = usopen_2018.player3
AND player3_score.tournament_name = 'U.S. Open'
AND player3_score.year = 2018
WHERE usopen_2018.cut = 0 AND usopen_2018.wd = 0
ORDER BY team_total, player1, player2, player3, name
)AS t
)AS FINAL