Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
String PostgreSQL+;NHibernate->;LIKE节中的命名参数_String_Postgresql_Nhibernate_Sql Like_Named Parameters - Fatal编程技术网

String PostgreSQL+;NHibernate->;LIKE节中的命名参数

String PostgreSQL+;NHibernate->;LIKE节中的命名参数,string,postgresql,nhibernate,sql-like,named-parameters,String,Postgresql,Nhibernate,Sql Like,Named Parameters,在Spring+Hibernate应用程序中,我试图使用命名参数pasend 查询应该对数据库中保存为文本的xml文档中的值求和 SELECT document_type, SUM(CAST(substring(document_content ,'<ab.*>(.*[0-9])</ab>') as float)) as value, COUNT(*) FROM statistic_data_test WHERE column

在Spring+Hibernate应用程序中,我试图使用命名参数pasend 查询应该对数据库中保存为文本的xml文档中的值求和

    SELECT  document_type, 
     SUM(CAST(substring(document_content ,'<ab.*>(.*[0-9])</ab>') as float)) as value, COUNT(*)
     FROM  statistic_data_test 
     WHERE column LIKE :param1::text
     GROUP BY document_type 
     ORDER BY value DESC 
转向误差


怎样才能做到呢?如何在查询中连接stings?

更改策略,保持目标不变

使用
位置
功能

position(:param1::text in column) <> o
位置(:param1::列中的文本)o

谢谢,它看起来正是我想要的;)但有没有办法检查除了param之外是否没有其他内容在列中?像ofc这样的公司是做不到的,但最好使用一种方法。@T.G-好吧,
LIKE
只需不包含百分号就可以做到这一点,但是如果你不只是使用
=
来完成这项工作,那么任何更大的数据都会对你的性能造成重大影响。锤子钉钉子,螺丝刀钉。
position(:param1::text in column) <> o