Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[错误报告]: 描述net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "," "," at line 2, column 1101. Was expecting one of: ")" "CONNECT" "EXCEPT" "FOR" "GROUP" "HAVING" "INTERSECT" "INTO" "MINUS" "START" "UNION" "WINDOW" #6637

Open
3 tasks done
1198735966 opened this issue Dec 19, 2024 · 4 comments

Comments

@1198735966
Copy link

确认

  • 我使用的版本是最新版, 并且使用插件确认过项目里无依赖版本冲突
  • 我已经在 issue 中搜索过, 确认问题没有被提出过
  • 我已经修改标题, 将标题中的 描述 替换为遇到的问题

当前程序版本

3.5.1

问题描述

net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "," ","
at line 2, column 1101.

Was expecting one of:

")"
"CONNECT"
"EXCEPT"
"FOR"
"GROUP"
"HAVING"
"INTERSECT"
"INTO"
"MINUS"
"START"
"UNION"
"WINDOW"

详细堆栈日志

Encountered unexpected token: "," ","
    at line 2, column 1101.

Was expecting one of:

    ")"
    "CONNECT"
    "EXCEPT"
    "FOR"
    "GROUP"
    "HAVING"
    "INTERSECT"
    "INTO"
    "MINUS"
    "START"
    "UNION"
    "WINDOW"
jsql 升降版本都没用,issue 里也找了,试了几个不好使啊,
@1198735966
Copy link
Author

看SQL也没有哪些需要按照规避 net.sf.jsqlparser.parser.CCJSqlParserConstants#tokenImage

@1198735966
Copy link
Author

jsql的事,在这能得到解决办法不

@1198735966
Copy link
Author

3.4.1 试了,也报这个问题

@1198735966
Copy link
Author

    String sql = "select count(0) from (" +
            "select mo.* from(SELECT T.SYSID, T.code AS \"code\", T.produ_code AS \"produCode\", T.produ_name AS \"produName\", to_char( T.planned_begin_date, 'yyyy-MM-dd hh24:mi' ) AS \"plannedBeginDate\", to_char( T.planned_end_date, 'yyyy-MM-dd hh24:mi' ) AS \"plannedEndDate\", T.ext10 AS \"linecode\", mm.NAME AS \"linename\", mp.shift_name AS \"shiftName\", T.ext01 AS \"shiftCode\", T.qty AS \"qty\", T.qty - T.complete_qty as \"uncompleteQty\", T.complete_qty - to_number( nullif ( T.ext06, '' ), '9999' ) AS \"qualifyQty\", T.complete_qty AS \"completeQty\", T.ext06 AS \"ext06\", T.receive_qty AS \"receiveQty\", T.ext05 AS \"ext05\", T.seq AS \"seq\", T.STATE AS \"state\", T.ext02 AS \"ext02\", T.ext03 AS \"ext03\", T.ext04 AS \"ext04\", T.ext07 AS \"ext07\", T.ext08 AS \"ext08\", T.ext09 AS \"ext09\", T.ext11 AS \"ext11\", T.ext12 AS \"ext12\", T.ext13 AS \"ext13\", T.ext14 AS \"ext14\", T.ext15 AS \"ext15\", T.lot_code AS \"lotCode\", T.work_order_type AS \"workOrderType\", T.nature as \"nature\", T.order_id AS \"workOrderCode\", T.remark AS \"remark\", T.state_jit as \"stateJit\", T.state_jis as \"stateJis\", us.name AS \"createId\", T.create_date AS \"createDate\", use.name AS \"modifyId\", T.modify_date AS \"mopdifyDate\", mb.drawing as \"drawing\" FROM pa_work_order T LEFT JOIN pa_plan_order order1_ ON order1_.SYSID = T.SYSID LEFT JOIN md_route_line route3_ ON route3_.SYSID = T.route_id AND route3_.is_del = 0 AND route3_.is_active = 0 left join md_bd_mrl mb on mb.code = T.produ_code and mb.is_del = 0 AND mb.is_active = 0 LEFT JOIN md_work_center mm ON mm.code = T.ext10 AND mm.is_del = 0 AND mm.is_active = 0 left join sys_user us on us.username = T.create_id and us.is_del = 0 and us.is_active = 0 left join sys_user use on use.username = T.modify_id and use.is_del = 0 and use.is_active = 0 LEFT JOIN ( SELECT T .code, A.code AS shift_code, A.NAME AS shift_name FROM md_work_shift_class T INNER JOIN md_work_shift A ON T.SYSID = A.work_shift_class_id WHERE T.is_del = 0 AND T.is_active = 0 AND A.is_del = 0 AND A.is_active = 0 ORDER BY T.code, A.code ) mp ON mp.shift_code = T.ext01 WHERE 1 = 1 AND T.is_del = 0 AND T.is_active = 0 order by t.seq desc )mo" +
            " ) tmp_count";
   ;
    Statement parse = CCJSqlParserUtil.parse(sql);
    System.out.println(parse);       解析这个SQL异常,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant