Home > Blockchain >  Not matching value starting with hyphen in column values
Not matching value starting with hyphen in column values

Time:06-10

We have few column values in SQL Server which starts with hyphen. What is correct query to get the exact match for this values. eg column value

- Abc test value
Select * from table
where column='- Abc test value'

CodePudding user response:

There is like operator with which you can return value starting with hyphen.

    - Abc test value
    Select * from table
    where column like '-%'

CodePudding user response:

this is resolved now.Db had control character 9 in between.After copying Windows would replace it with space and hence comparison would fail.

  • Related