Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/03/2024 03:05 AM
Hi,
We have to replace and its not working as its an exact match based on case sensitive:
select REPLACE('North Canton OH Retail' , 'REtail' , ''), it is not giving the exact result.
select REPLACE('North Canton OH Retail' , 'Retail' , ''), it is working good.
Since when SQL is a case sensitive language?
Solved! Go to Solution.
07/03/2024 03:24 AM
Hi @Shubhamjain27 , replace function is
Try this should solve your issue
select REPLACE(lower(North Canton OH Retail), lower(REtail), '')
07/03/2024 03:27 AM
It will yes but it will also get result in lower case. The result should be in the same format.
07/03/2024 03:29 AM
What is your use case??
07/03/2024 03:26 AM
Hi @Shubhamjain27 ,
Replace function is case sensitive.
Remember, the REPLACE SQL function is case-sensitive. If your database collation is case-sensitive and you wish to perform a case-insensitive replacement, you might need to use additional functions specific to your SQL dialect (like LOWER() or UPPER()) to standardize string case before replacement.
The REPLACE() function replaces all occurrences of a substring within a string, with a new substring.
Note: This function performs a case-sensitive replacement.
07/03/2024 04:22 AM
on W3schools its working :
I will change the syntax accordingly.
Thanks
07/03/2024 03:36 AM
@Shubhamjain27 REPLACE performs a case-sensitive replacement.