I try to run this code, but I am getting an error: ParseException line 4:2 missing EOF at 'JOIN' near 'tf_posting'
DELETE
FROM
ez_014315_tap.tf_posting
JOIN (
SELECT
MAX(
FROM_UNIXTIME(
UNIX_TIMESTAMP(dupl_run_ime.run_timestamp)
)
) AS max_run_timestamp
FROM
(
SELECT
geo_zone,
run_timestamp,
COUNT(*)
FROM
ez_014315_tap.tf_posting
WHERE
mandant_id = '001'
AND geo_zone = (
SELECT
DISTINCT geo_zone
FROM
ez_014315_tap.tf_posting
WHERE
mandant_id = '001'
)
GROUP BY
geo_zone,
run_timestamp
) AS dupl_run_ime
) tt1 on tt1.max_run_timestamp = from_unixtime(
unix_timestamp(tf_posting.run_timestamp)
);
Can someone help me to find this missing end of line?