I have the following SQL query:
$query="
SELECT post_id,FIND_IN_SET(
post_id,(SELECT GROUP_CONCAT( post_id ORDER BY meta_value * 1 DESC)
FROM $wpdb->postmeta
WHERE meta_key ='ma_ratings_average')
) AS rank
FROM $wpdb->postmeta
WHERE meta_key ='ma_ratings_average'
AND post_id = '".$post_id."'
";
And since upgrading to MySQL 8, I am getting this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank FROM wp_postmeta WHERE meta_key ='ma_ratings_average'
What does this mean and what's the route to resolve it?