January 5, 2006 at 6:14 am
Brain has gone blank....
how would you do a select distinct but where you want distinct values from one column but then you want all other columns from the table the problem being one of the other columns has unique values...
hope I have worded this ok.
January 5, 2006 at 6:49 am
Hi Geoff - please provide three or four lines of source data and then an example of the results that you would like, based on that data.
If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.
January 5, 2006 at 6:53 am
Not possible as the 'unique column' will prevent distinction
You will either have to
ignore the 'unique column' e.g.
SELECT col1,col2,col3 FROM
GROUP BY col1,col2,col3
or aggregate the 'unique column' e.g.
SELECT col1,col2,col3,MIN([unique column]) FROM
GROUP BY col1,col2,col3
It would help if you could post DDL, sample data and expected output to better understand your requirements.
Darn, Phil beat me to it
Far away is close at hand in the images of elsewhere.
Anon.
January 6, 2006 at 6:16 am
See http://qa.sqlservercentral.com/forums/shwmessage.aspx?forumid=169&messageid=248544 which is another example of the same requirement.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply