H5W3
当前位置:H5W3 > 其他技术问题 > 正文

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

帮忙看看这是怎么回事呢

回答:

ORDER BY
    pm.category_code 
    LIMIT 0,
    10; # 注意这里
SELECT
    FOUND_ROWS() AS total;

你这是两条语句了

本文地址:H5W3 » JPA执行SQL报错,但是sql语句直接在navicat中执行成功

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址