I have a peculiar requirement in Oracle. There is a column in a table with different values but sounds similar for ex: Limited, Ltd, Ltd., Etc. But I need to treat these same and shouldn't treat as distinct values. I tried it with Decode as below but the catch here is the values are not known to us. Below is just an example.
Create table test_dup(col1 varchar2(25));
Insert into test_dup values('limited');
Insert into test_dup values('ltd.');
Insert into test_dup values('Inc');
Insert into test_dup values('incorporate');
Select distinct decode(col1, 'limited', 1, 'ltd.', 1, 'Inc', 2, 'incorporate', 2) from dual;
This works when the values are known but in my requirement, the values are unknown.
Please help me resolve this.
Thanks in advance, Savitha