private const string SQL_SELECT = "SELECT * FROM t_table WHERE patindex('%,' + rtrim(id) + ',%',',' + @pvlist + ',') > 0";
private const string PARM_PVLIST = "@pvlist";同样的SQL语句在SQLServer里能通过
用Npgsql就出问题了,应该是Npsql的类型转换不完善,看看哪位高人有解决办法如上,用rtrim(id)提示
Npgsql.NgpsqlException:
function retrim(integer) does not exist
Serverity: Error
Code: 42883用rtrim(cast(id as text))提示
Npgsql.NgpsqlException:
operator does not exist: unknown + text
Serverity: Error
Code: 42883把'%,'也加上cast('%,' as text)提示
operator does not exist: text+ textSQLServer会自动进行类型换号
这里搞的一塌糊涂
求解决办法