sql中的正则表达式
这是我的sql语句:select sum(ctSuccess), sum(cuSuccess), sum(cmSuccess) from (select desttermid REGEXP '^%s$' as ctSuccess, desttermid REGEXP '^%s$' as cuSuccess ,desttermid REGEXP '^%s$' as cmSuccess from emap_sm_mt_sent_log where reserved1='%s') a
执行sql
SQLQuery sysSql = session.createSQLQuery(String.format(phoneSuccess, MobileUtil.ct, MobileUtil.cu,MobileUtil.cm,sysaccountid));
在连mysql数据库时是对的,但是连sql server2008时就报^%s$'这个参数附近有语法错误,在sql server中不支持REGEXP
'^%s$'吗??
[解决办法]