开发者

SQL WHERE LIKE with tab

开发者 https://www.devze.com 2023-04-01 02:54 出处:网络
Seems like suc开发者_开发百科h a simple thing.I need to specify a WHERE criteria with the LIKE operator and include a tab in the expression.

Seems like suc开发者_开发百科h a simple thing. I need to specify a WHERE criteria with the LIKE operator and include a tab in the expression.

SELECT * FROM table WHERE field LIKE '%Run1[TAB]%';

I've tried \t, \\t, %t and the char operator.

I am working in Sqlite.

Thanks.


try

CAST(X'09' AS TEXT)

for the tab character


I'm using DB2, but maybe this solution is something you can use on Sqlite also.

Try using the chr function. I think in ASCII the tab character has value 8. In DB2 the following works

SELECT * FROM table WHERE field LIKE '%' || chr(8) || '%'
0

精彩评论

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