Taking a sample table:
WITH t(val) AS
( SELECT 'my Name' FROM dual
UNION
SELECT 'my name' FROM dual
UNION
SELECT 'my naim' FROM dual
UNION
SELECT 'MY kat' FROM dual
UNION
select 'my katt' from dual
)
SELECT * FROM t;
I need an output by preference:
The query should search for the exact match in the table first,
If not found then search by lowering the case, and if not found then only search for soundex,. So the final output for something like:
WHERE val = 'my Name'
OR lower(val) = lower('my Name')
OR soundex(lower(val)) = soundex(lower('my Name'))
should be:
output
-----
my Name
Thanks in advance.