Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2006
    Posts
    12

    Unanswered: Duplicate rows in result set (was Quick Question.)

    im writing a select statement.

    i have my
    select (what i want)
    from (my tables)
    where (my conditions and joins)
    order by (how i want it ordered)

    my question is this.
    in the results of the statement.
    i am getting multiple lines for the same entry.
    like im pulling names and the names are comming more than once

    any suggestions?

    my database is sybase 12.5

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    One (or more) of your joins is loose... You don't have specific enough join criteria somewhere.

    -PatP

  3. #3
    Join Date
    Apr 2006
    Posts
    12
    well the problem is is
    i had made all of my links that i could make

    my ultimate resolution to this problem was doing a
    "group by" statement and grouped it by a few of the
    items in my original statement.
    i was createing a view and was trying to get the select statment to work

    only problem im having now is that when i do a

    select * from (view name)
    it henders performance of the database

    any suggestions here or just suck up and deal?

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    You'll have to make a judgement call here.

    I'm nearly certain that you could adjust your JOIN operations to fix the underlying problem. This would give you the best overall performance, since you wouldn't be using server resources to construct useless rows in your result set, then using more server resources to group the rows to remove the useless rows. This strikes me as just a waste.

    The time needed to fix the problem might be more than the problem is worth. If you'll only use this code once, the time needed to fix it is probably more expensive than the resources the code will waste. However, if you are going to use the code repeatedly, the balance tends to tip toward making a fix more economical in the long run.

    It is your call to make, but I'd recommend fixing the JOIN instead of GROUPing to hide the problem.

    -PatP

Posting Permissions

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