i'm not "missing" it -- just "adding" more food for thought :-)) something's
fundamentally wrong with the query/question.
> You're missing the "Where country='something'" line, which was what Ray
> commenting on. Put that line into the query, and then tell us what the use
> of either the "group by" or "order by" clauses is.
> Bob Barrows
> > then i wonder what does a DISTINCT do with a GROUP BY clause!?
> > re the original question:
> > select country
> > from customers
> > group by country
> > order by max(companyname)
> > works just fine in Northind db.
> > cheers,
> > </wqw>
> > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in
> >> Okay, I am in no way a querying expert or even a novice, but "select
> >> distinct column1 where column1='something'" will always return just
> >> one single record, yes? So, why would ordering even matter, unless
> >> you're trying to get just one column with a lowest column2 value.
> >> If that's the case, I'd do:
> >> select top 1 column1 where column1='Test' order by column2
> >> Ray at home
> >> --
> >> Will trade ASP help for SQL Server help
> >>> Hi all
> >>> I need to write an SQL like
> >>> Select distinct column1 from table1
> >>> where column1='Test'
> >>> Group by Column1
> >>> Order by Column2
> >>> B'coz ORDER BY items must appear in the select list if
> >>> SELECT DISTINCT is specified.
> >>> Is it possible using sub query we can sole this. I don't
> >>> want to use a temp table.
> >>> Thanks in advance
> >>> Anand