开发者

SQL LIKE Column Value Plus Wildcard DB2

开发者 https://www.devze.com 2023-03-22 08:38 出处:网络
I\'m trying开发者_StackOverflow to use a column and a wildcard in a LIKE clause. I was expecting this to work:

I'm trying开发者_StackOverflow to use a column and a wildcard in a LIKE clause. I was expecting this to work:

WHERE COLUMNA LIKE '%'||COLUMNB||'%'

Is this supported in DB2?


Should be able to use the locate syntax (http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2.doc.sqlref/fsubstr.htm)

WHERE LOCATE(COLUMNB,COLUMNA) > 0
0

精彩评论

暂无评论...
验证码 换一张
取 消