繁体   English   中英

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

[英]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)

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

您可以使用转义标识符

--Queries

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM