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)
 simple tsql problem

Author  Topic 

mikejohnson
Posting Yak Master

153 Posts

Posted - 2003-12-18 : 17:28:11
i have a table with an id and one other field. if i want to select just the distinct other field and the id field, how would that go? i tried 'select distinct(other),id from tablename' but that returns all of them

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-12-18 : 17:42:27
SELECT MAX(id), other
FROM Table1
GROUP BY other

If that isn't what you want, please provide a simple example of what the data looks like and what the query should return.

Tara
Go to Top of Page
   

- Advertisement -