0
語句
我無法弄清楚什麼是錯用下面的查詢:錯誤在MySQL查詢有關IF在SELECT
_mysql_exceptions.ProgrammingError: (1064, "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
'continue,\n\t\t\t\t\t\t\tIF(t_sh.content REGEXP '[;}[:space:]]throw ', 'true', 'false') ' at line 6")
:當用python的MySQLdb的運行
SELECT t_sh.source_file_id,
t_sh.id,
MAX(t_sh.master_event_id),
IF(t_sh.content REGEXP '[;}[:space:]]break;', 'true', 'false') AS break,
IF(t_sh.content REGEXP '[;}[:space:]]break ', 'true', 'false') AS break_label,
IF(t_sh.content REGEXP '[;}[:space:]]continue;', 'true', 'false') AS continue,
IF(t_sh.content REGEXP '[;}[:space:]]throw ', 'true', 'false') AS throw,
IF(t_sh.content REGEXP '[;}[:space:]]return;', 'true', 'false') AS void_return
FROM source_histories AS t_sh,
( SELECT DISTINCT source_file_id
FROM source_histories
WHERE content <> NULL
AND content REGEXP '[;}[:space:]]break;|[;}[:space:]]break |[;}[:space:]]continue;|[;}[:space:]]throw |[;}[:space:]]return;'
) AS t_uniqueSFI
WHERE t_sh.source_file_id = t_uniqueSFI.source_file_id;
它給我下面的錯誤
我是SQL新手,非常感謝您的幫助。
非常感謝!我應該知道看保留字。 – sdsmith