duplicate name [message #480872] |
Thu, 28 October 2010 00:16 |
narang79
Messages: 135 Registered: June 2010
|
Senior Member |
|
|
i have a employee table
i want to find out duplicate name from this table
so i write following query
select empname from employee
having count(empname) >1
group by empname
i find the result but problem is how i can find out the same name if it have any space like
ramkumar ram kumar both are same but above query did not
give this data
how i can solve it
|
|
|
|
|
|
|
Re: duplicate name [message #480881 is a reply to message #480872] |
Thu, 28 October 2010 01:02 |
ayush_anand
Messages: 417 Registered: November 2008
|
Senior Member |
|
|
SQL> WITH datas AS
2 (
3 SELECT 'ramkumar' AS s1, 'ram kumar' AS s2 FROM dual union ALL
4 SELECT 'Waldar' , 'Walder' FROM dual union ALL
5 SELECT 'Perfect match' , 'Perfect match' FROM dual union ALL
6 SELECT 'Awful match' , 'Bad similitude' FROM dual
7 )
8 SELECT s1, s2,utl_match.jaro_winkler(s1, s2)
9 FROM datas
10 WHERE utl_match.jaro_winkler(s1, s2)> 0.96;
S1 S2 UTL_MATCH.JARO_WINKLER(S1,S2)
------------- -------------- -----------------------------
ramkumar ram kumar 9.741E-001
Perfect match Perfect match 1.0E+000
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: duplicate name [message #480958 is a reply to message #480957] |
Thu, 28 October 2010 10:46 |
|
Michel Cadot
Messages: 68651 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Michel Cadot wrote on Thu, 28 October 2010 07:24Hint use REPLACE to "remove" spaces in COUNT expression, use COUNT in its analytic form.
If you post a working Test case: create table and insert statements along with the result you want with these data then we will work with your table and data.
Before, Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.
Regards
Michel
Tell me and I'll forget; show me and I may remember; involve me and I'll understand
[Updated on: Thu, 28 October 2010 10:52] Report message to a moderator
|
|
|