I am stuck with really weird situation. I am generating code from my php editor, and as you know I am getting code non-formatted all in one line.
Here's my code:
SELECT ua.id AS ua_id,
ua.activity_time AS ua_activity_time,
ua.user_id AS ua_user_id,
ua.charter_id AS ua_charter_id,
'table' AS ua_table_name,
Concat(Round(Timestampdiff(minute, ua.activity_time, Now()) / 30, 0), '-'
, ua.charter_id) AS delimiter
FROM user_activity_charter_update AS ua
WHERE ua.activity_time BETWEEN '2018-07-10 00:00:00' AND '2018-08-10 00:00:00'
It reports syntax 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 'user_activity_charter_update AS ua WHERE ua.activity_time BETWEEN '2018-07-10 00' at line 1
But what is more weird when I hit space before FROM and put it in new row, query works fine.