Can you give us an example with data?
--
Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
.
I am trying to select distinct columns and add a non-disticnt column
to my list.
This query works great in finding distinct records:
SELECT DISTINCT
firstname,
lastname,
middleinitial,
address1,
address2,
city,
state,
zip,
age,
gender,
FROM table
ORDER by zip
However, I have a column called DATE that I want to add to the results
of my query but I DO NOT want this to be a DISTINCT column. How do I
go by excluding a column from being DISTINCT in my select distinct
statement but adding it after the fact?