mengxr1203 2017-10-17 09:15 采纳率: 0%
浏览 1445
已结题

sql语句在数据库可以运行,放在jeecg的实体类里用@Formula就报错this_附近语法错误

图片说明
这是打印出他自动转化的HQL
Hibernate:
WITH query AS (select
this_.id as id8_0_,
this_.code as code8_0_,
this_.create_by as create3_8_0_,
this_.create_date as create4_8_0_,
this_.name_cn as name5_8_0_,
this_.name_en as name6_8_0_,
this_.update_by as update7_8_0_,
this_.update_date as update8_8_0_,
(select
stuff((select
','+c.name_cn,
ROW_NUMBER() OVER (
ORDER BY
CURRENT_TIMESTAMP) as hibernate_row_nr
from
sys_country c
where
c.id in (select
b.country_id
from
sys_region_country b
where
b.region_id = (select
a.id
from
sys_region a
where
a.id=a.id))this_.for this_.xml path('')),1,1,'')) as formula0_0_
from
sys_region this_) SELECT
*
FROM
query
WHERE
hibernate_row_nr >= ?
AND hibernate_row_nr < ?

这是我写的SQL

SELECT STUFF((select ','+NAME_CN from SYS_COUNTRY c WHERE c.ID in (select b.COUNTRY_ID from SYS_REGION_COUNTRY b WHERE b.REGION_ID = (select a.ID from SYS_REGION a WHERE a.ID=a.ID))
FOR XML PATH('')), 1, 1, '')

  • 写回答

1条回答 默认 最新

  • devmiao 2017-10-17 15:52
    关注
    评论

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?