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:
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.
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.