Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2002
    Posts
    20

    Red face Unanswered: data duplication

    Dear All

    I have SELECT clause which uses loads of OUTER JOINS to produce a table with loads of data needed for a front-end appliation

    But, some of the data it produces is replicated because of the JOINS

    e.g. an example of data is this

    person_id LastName FirstName LanguageSpoken Speciality

    1234 mySurNme my1stName FRENCH speciality1
    1234 mySurNme my1stName GERMAN speciality2
    1234 mySurNme my1stName FRENCH speciality1
    1234 mySurNme my1stName GERMAN speciality2


    I just want it to come out like this

    person_id LastName FirstName LanguageSpoken Speciality

    1234 mySurNme my1stName FRENCH speciality1
    1234 mySurNme my1stName GERMAN speciality2

    Can anyone help

    Gill

  2. #2
    Join Date
    May 2003
    Posts
    23
    You can try "Select distinct ....". This will eliminate duplicate rows.

  3. #3
    Join Date
    Dec 2002
    Posts
    20
    Originally posted by ts555
    You can try "Select distinct ....". This will eliminate duplicate rows.



    That's the first thing I tried - that doen't work

  4. #4
    Join Date
    Apr 2003
    Posts
    30
    If you use distinct, it should not return duplicates. It would be helpful if you give us your query.

  5. #5
    Join Date
    May 2003
    Posts
    26
    Originally posted by jzhu
    If you use distinct, it should not return duplicates. It would be helpful if you give us your query.
    A couple of things come to mind.

    1) Is the data clean? Dup records could cause a problem.

    2) Take a close look at your joins, you could be receiving a cartesian product.

    3) If the joins are correct the problem may be in the WHERE criteria. When joining many tables, especially where 1 to many relationships exists, its possible your WHERE clause is not specific enough to bring the number of returns down to a single row.

Posting Permissions

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