Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Posts
    87

    Unanswered: problem with compare query

    Hi everybody

    have this query that seems not working. it gives me results which to me isn't right.. The situation is this I have two tables to compare using the name field as the criteria.. the query should be Give me the names of people from pofficials where it does not exist on the member table.. With the query below it gives me one or two records that is present on pofficials and member.... I used the like clause because to get all the occurences of the name that begins with the subquery.

    select p.name
    from pofficials p
    where not exists
    (select name from member
    where p.name like m.name+ '%'
    )
    order by name

    thanks
    Last edited by alexiop; 05-14-09 at 14:20.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I don't understand why you have used LIKE.
    Code:
    ....
    where p.name = m.name
    If you add that then your code is correct based on what you describe. I am guessing this is not correct though, which means you are not telling us something.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Aug 2006
    Posts
    87
    Quote Originally Posted by pootle flump
    I don't understand why you have used LIKE.
    Code:
    ....
    where p.name = m.name
    If you add that then your code is correct based on what you describe. I am guessing this is not correct though, which means you are not telling us something.

    Hi ..
    I used the like just to get the occurences and not the exact equal p.name against m.name.. Analyzing though on the results of my query.. I've noticed that the twor records that appear on both have really a difference which is the accents.. one name has an accent and the other has none and vice versa.. that's why it is appearing. in conclusion the query is correct..

    thanks for your analysis.. I just couldn't figure out yesterday..what the difference is...

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    You can chose to ignore accents in your comparisons, or you can return results where they must match.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •