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.
Author |
Topic |
jimCrowe
Starting Member
2 Posts |
Posted - 2008-10-03 : 06:31:07
|
Hi, I'm having a few problems with a Select statement. Here the Scenario:Table - NamesNameID Name 1 Jon 2 Andrew3 SteveNames.NameID has a 1 to many relationship with NameStatusTracking.NameIDTable - NameStatusTrackingNameStatusTrackingID NameID StatusID1 1 12 1 23 2 14 4 35 1 36 3 17 2 2I need to select 'Names.Name' and there highest NameStatusTracking.StatusID for each person in the names table.E.g. I would like results to look likeName StatusIDJon 3Andrew 2Steve 1I've tried selecting Names.Name and Joining NameStatusTracking.StatusID but I obviously get all the StatusID's whereas I only wantthe highest!Manky thanks, Jim |
|
jimCrowe
Starting Member
2 Posts |
Posted - 2008-10-03 : 06:56:52
|
Hi Guys, All sorted I wasn't using the Group by clase on my aggregate functions |
 |
|
|
|
|