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

你离开我真会死。 提交于 2019-12-11 15:31:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!