Results 1 to 2 of 2

Thread: [RESOLVED] [Sybase] Return Multiple columns with Distinct

  1. #1

    Thread Starter
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Resolved [RESOLVED] [Sybase] Return Multiple columns with Distinct

    I have a select query that returns 92 rows with 5 columns, including some duplicates.
    If I do a select distinct query like this I can return the correct number of rows (47), although this only returns 1 column
    Code:
    SELECT distinct id FROM #tmpDoc
    How can I add the rest of the 4 columns to this result?
    This query returns more than 47 rows, and some of the ids in the rows are duplicates.
    Code:
    SELECT distinct id, col2, col3, col4, col5 FROM #tmpDoc

  2. #2

    Thread Starter
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: [Sybase] Return Multiple columns with Distinct

    Problem was the tmp table was the result of a join that was returning incorrect data.

Posting Permissions

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



Click Here to Expand Forum to Full Width