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

图片说明
这是打印出他自动转化的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个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐