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

帮忙看看这是怎么回事呢

阅读 4.9k
1 个回答
ORDER BY
    pm.category_code 
    LIMIT 0,
    10; # 注意这里
SELECT
    FOUND_ROWS() AS total;

你这是两条语句了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题