'SQL Query like Condition not working as expected
I have a query in SQL Server and have values like that is enclosed in the quote. I am trying to filter the value which has CC_ somewhere in the string. In the query when I try to filter the values using %CC_%, it is still returning the values though it is not present in the string.
with a as (
Select '@IDESC("Account"),@IDESC("Period"),@IDESC("View"),@IDESC("Scenario"),@IDESC("Version"),@IDESC("Years"),@IDESC("Currency"),@IDESC("Product"),@IDESC("FX View"),@IDESC("Data_Type"),@IDESC("Entity"),@IDESC("Function"),@IDESC("Market"),@IDESC("Business_Unit"),@IDESC("Reporting_Unit")'
as val)
select * from a where val like '%CC_%'
Can experts please help?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
