尝试从sqoop中选择时出现MySQLSyntaxErrorException

时间:2018-09-19 21:29:36

标签: mysql sqoop

我们的工作遵循SQL来生成报告。这个成功了。

SELECT sale_alerts_id,
       email,
       first_name,
       last_name,
       address_1,
       address_2,
       apt_for_suite,
       city,
       state,
       zip_code,
       phone,
       cast(capture_tmst as char),
       capture_id,
       associate_id,
       store_nbr,
       cast(last_updated_tmst as char),
       subscribed_ind,
       cookie_id  
FROM account.est_sale_alerts 
WHERE last_updated_tmst>"2018-09-13 12:14:58" 
  AND last_updated_tmst <= "2018-09-14 00:30:45:502767" 
  AND 1=1;

此失败并显示错误:

SELECT sale_alerts_id,
       email,
       first_name,
       last_name,
       address_1,
       address_2,
       apt_for_suite,
       city,
       state,
       zip_code,
       phone,
       cast(capture_tmst as char),
       capture_id,
       associate_id,
       store_nbr,
       cast(last_updated_tmst as char),
       subscribed_ind,
       cookie_id 
FROM account.est_sale_alerts 
WHERE last_updated_tmst>"2018-09-16 00:30:45" 
  AND last_updated_tmst <= "2018-09-16 12:30:46:462785"
  and 1=1;

错误是:

  

19-09-2018 15:30:17 CDT sale-alerts-pii-l1信息-由:   com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:您有一个   您的SQL语法错误;检查与您的手册相对应的手册   MySQL服务器版本,可在``76 ?????'')'附近使用正确的语法   在第1行

第二个查询为什么出错?

P.S:如果有任何编辑错误,我可以纠正。我是这个论坛的新手。

0 个答案:

没有答案