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 2005 Forums
 Transact-SQL (2005)
 Grouping Data

Author  Topic 

starnold
Yak Posting Veteran

83 Posts

Posted - 2008-03-26 : 08:33:29
I have a set of data that contains duplicates and I am running a group by query to get a unique set of rows.

The group by works upto a certain state, but I need to be able to tell it to take the first appearance of an address field as you can in Access?

current query is:

select ID,Address1,max(value)
from test
group by id,address1

I have tried using First(Address1) but it doesn't recognise that as a function?

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-03-26 : 08:52:30
probably worth posting in the Access forums

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

starnold
Yak Posting Veteran

83 Posts

Posted - 2008-03-26 : 08:55:16
I am trying to run this query within SQL though =)
Go to Top of Page

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-03-26 : 09:53:51
i rememberd a recent thread that may be useful to you...

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=60565

Em
Go to Top of Page
   

- Advertisement -