Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    1

    Unanswered: SELECT distinct problem - HELP!!!!

    I'm trying to select a recordset from a table without getting duplicates on only one column and can't figure out how to do it. Here is the table structure:

    Tablename: ev_textmessageusers
    Columns: id (unique int) | clientid (int) | email (nvarchar) | groups (nvarchar) | datecreated (datetime)

    What i'd like to do is:
    SELECT DISTINCT(email), [and then the other columns - not distinct] FROM ev_textmessageusers WHERE clientID = 1

    But this obviously can not be done. I've tried to do it with a GROUP BY clause and I can't get that to work either. The groups and datecreated columns may or may not be unique - but I still want to get their values returned in the recordset.

    Thanks for your help!!!

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'm still not very clear on what you want. Your description of your problem seems to be that you want one column distinct, but all the rest in detail (no aggregation). That doesn't make sense to me.

    Can you post a table definition and a few rows of data to show at least three examples of what you want?

    -PatP

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I'm going to hazard a guess here that you are trying to create a report that lists all the messages, but does not repeat the "email" value. If so, then this is a formatting issue, and is best left to your report designer. Most reporting applications (Access, Crystal...) have a method for hiding duplicate values in consecutive rows.

    SQL Server is not a reporting interface, and you should not use it as such.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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