现在的位置: 首页 > 综合 > 正文

一个nhibenate的hql问题!

2011年04月02日 ⁄ 综合 ⁄ 共 401字 ⁄ 字号 评论关闭
from t_mib_item a where instr(substring(a.item_name,5),'.')=0 and a.item_name like 'com.%';

翻译成sql语句
select
count(tmibitem0_.ID) as x0_0_ from t_mib_item tmibitem0_, t_mib_item
tmibitem1_ where (tmibitem0_.ITEM_NAME like concat('com' ,
'.%'))and(tmibitem0_.TERM_MODEL_ID=1 , model.id(tmibitem1_.ITEM_NAME
like 'com.%' )and(tmibitem1_.TERM_MODEL_ID=1
)and(instr(substring(tmibitem1_.ITEM_NAME , 5), '.')=0 )

中间没有空格了。

请问关于instr的hql语句该如何来写?

抱歉!评论已关闭.