1

I'm having a same data in 2 different table columns. When I comparing it returns False.

select (case when 'Gurgaon / Delhi – NCR' = 'Gurgaon / Delhi - NCR' then true else false end)

But when copy and compare the same column text it returns True

select (case when 'Gurgaon / Delhi – NCR' = 'Gurgaon / Delhi – NCR' then true else false end)

How those word differs and how can I find and resolve this?

UPDATE In table one column stored as \96 and I changed to -. Is that causing the problem?

Vanjith
  • 520
  • 4
  • 23

1 Answers1

0

If what you want is to replace a character by another in a string, you can use the REPLACE() function.

This function is described in the documentation: https://www.postgresql.org/docs/current/functions-string.html

For example: SELECT REPLACE('Gurgaon / Delhi – NCR', '–', '-')

After that you could have a match between your two strings if it is that you still want.

Hope this helps.

Jaisus
  • 1,019
  • 5
  • 14