enter image description hereI want to select the soundex value S225  for the two names

This is what iried using this query but am not getting the exact result.

I got the output with the same name and same soundex value, but I want the result which has similar name and same soundex value.

Can anyone help me to do this?

  • Please give some examples that you'd like to find. How similar is similar?
    – dezso
    Jul 9, 2015 at 11:06
  • 1
    And please do not post SQL statements as screen shots. Show the statements as formatted text.
    – user1822
    Jul 9, 2015 at 11:14

1 Answer 1


You can use a window function for this:

select *
from (
   select name, 
          count(*) over (partition by soundex(name)) as cnt
   from poi
) t
where cnt > 1;
  • It Works...................... Thank u so much ...a_horse_with_no_name. then, what does the variable 't' stands for in that query? Jul 9, 2015 at 11:46
  • 1
    @MohamedAshrafAliB it's not a variable but a mandatory table alias for a subquery.
    – dezso
    Jul 9, 2015 at 11:59
  • @a_horse_with_no_name Jul 22, 2015 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.