如何选择,其中列数据中包含“%”的值的表的列名?(How to select the column

2019-10-28 17:01发布

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

例如:在表COMP有两列(ADDR,COMP_NAME),其在它的字符串具有含有数据“%”。 所以我的查询应该返回那些COLUMN_NAMES(地址,COMP_NAME)

Answer 1:

我不明白你的权利,但我的东西,这将帮助你

您可以使用转义标识符

--Queries

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

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


文章来源: How to select the column names of a table where column data contains '%' in the values?