JPA执行SQL报错,但是sql语句直接在navicat中执行成功

SELECT SQL_CALC_FOUND_ROWS
    pm.id AS id,
    pm.category_code AS categoryCode,
    pm.category_name AS categoryName,
    pm.material_name AS materialName,
    pm.material_a AS materialA,
    pc.classification_one AS classificationOne,
    pc.classification_two AS classificationTwo,
    pc.classification_three AS classificationThree 
FROM
    product_material_system_category pc
    LEFT JOIN product_material_system_main pm ON pm.category_code = pc.category_code 
WHERE
    pc.classification_one LIKE '%内墙%' 
    OR pc.classification_two LIKE '%内墙%' 
    OR pc.classification_three LIKE '%内墙%' 
ORDER BY
    pm.category_code 
    LIMIT 0,
    10;
SELECT
    FOUND_ROWS() AS total;

clipboard.png

clipboard.png

帮忙看看这是怎么回事呢

阅读 719
评论 更新于 2019-06-27
    1 个回答
    _TNT_
    • 2.8k
    ORDER BY
        pm.category_code 
        LIMIT 0,
        10; # 注意这里
    SELECT
        FOUND_ROWS() AS total;

    你这是两条语句了

    评论 赞赏 2019-06-28
      撰写回答

      登录后参与交流、获取后续更新提醒