簡體   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