开发者

SQL WHERE LIKE with tab

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜