问题
How to select the column names of a table where column data contains '%' in the values?
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)
回答1:
I dont get you right but i thing this will help you
You can use the escape identifier
--Queries
-- for %
select * from test_a where col1 like '%\%%' escape '\';
--for _
select * from test_a where col1 like '%\_%' escape '\';
来源:https://stackoverflow.com/questions/47163404/how-to-select-the-column-names-of-a-table-where-column-data-contains-in-the