Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 select distinct

Author  Topic 

lane0618
Posting Yak Master

134 Posts

Posted - 2002-10-28 : 20:37:46
When I run this:

select distinct item,UM,DESC1,DESC2
from lcampbel.[ana_item_fixed]

I get more results than if I run this:

select distinct item
from lcampbel.[ana_item_fixed]

How do I get the same number of rows returned when I run the upper sql.

Thanks,
Lane

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-28 : 20:43:20
SELECT item, MAX(UM) UM, MAX(DESC1) DESC1, MAX(DESC2) DESC2
FROM lcampbel.[ana_item_fixed]
GROUP BY item

Go to Top of Page
   

- Advertisement -