如何选择表的列名,其中列数据的值中包含“%"? [英] How to select the column names of a table where column data contains '%' in the values?

查看:78
本文介绍了如何选择表的列名,其中列数据的值中包含“%"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何选择表的列名,其中列数据的值中包含%"?

How to select the column names of a table where column data contains '%' in the values?

例如:在表COMP中有两列(Addr,Comp_Name),其字符串中包含%"的数据.所以我的查询应该返回那些column_names(Addr,Comp_Name)

Eg: In the table COMP there are two columns(Addr, Comp_Name) which has data containing '%' in its string. So my query should return those column_names(Addr, Comp_Name)

推荐答案

我不正确,但我认为这对您有帮助

I dont get you right but i thing this will help you

您可以使用转义标识符

--Queries

-- for %
select * from test_a where col1 like '%\%%' escape '\';

--for _ 
select * from test_a where col1 like '%\_%' escape '\';

这篇关于如何选择表的列名,其中列数据的值中包含“%"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆