mybatis sql查询报错,mysql识别不了CONNECT, 还有会把参数为String的id转为int来查,导致查询报错

Blade 未结 1 187
liuhao07
liuhao07 剑童 2023-05-26 14:42

### SQL: SELECT         id,         real_name AS "title",         id AS "value",         id AS "key",         TRUE AS "user",         CAST(REGEXP_SUBSTR(dept_id, '[^,]+', 1, LEVEL)AS Decimal(24)) as parentId         FROM blade_user         WHERE         is_deleted = 0                       and tenant_id = ?                             CONNECT BY LEVEL <= REGEXP_COUNT(dept_id, '[^,]+')         AND ROWID = PRIOR ROWID         AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL

### Cause: java.sql.SQLSyntaxErrorException: 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 'CONNECT BY LEVEL <= REGEXP_COUNT(dept_id, '[^,]+')

        AND ROWID = PRIOR ROW' at line 15


1条回答
  • 2023-05-26 14:45

    这不是bladex系统的模块吧,自己写的就用mysql兼容的语法来

    0 讨论(0)
提交回复