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 |
|
velnias2010
Posting Yak Master
125 Posts |
Posted - 2011-04-05 : 11:42:33
|
| SELECT DISTINCT organisationVoluntary.inkexID, organisationVoluntary.orgLogoURL, organisationRegulatory.name, organisationVoluntary.orgStrapline, organisationVoluntary.overviewURL, actionsTaken.dateAddedFROM organisationVoluntary INNER JOIN organisationRegulatory ON organisationVoluntary.inkexID = organisationRegulatory.inkexID INNER JOIN actionsTaken ON organisationVoluntary.inkexID = actionsTaken.inkexIDWHERE (organisationVoluntary.orgLogoURL <> 'NULL') AND (organisationVoluntary.orgLogoURL <> '')GROUP BY organisationVoluntary.inkexID, organisationVoluntary.orgLogoURL, organisationRegulatory.name, organisationVoluntary.orgStrapline, organisationVoluntary.overviewURL, actionsTaken.dateAddedORDER BY actionsTaken.dateAdded DESCData Looks Like7938 INKEx14032011125607.png IRISH NONPROFITS KNOWLEDGE EXCHANGE Action Inishowen Limited Strapline NULL 24/03/2011 14:37:437938 INKEx14032011125607.png IRISH NONPROFITS KNOWLEDGE EXCHANGE Test Strapline NULL 24/03/2011 14:37:431779 INKEx1403201112560715032011164820.png ACTION INISHOWEN LIMITED NULL 24/03/2011 12:43:037938 INKEx14032011125607.png IRISH NONPROFITS KNOWLEDGE EXCHANGE Action Inishowen Limited Strapline NULL 23/03/2011 15:14:55The First Column is called inkexID, Basically I only want 1 row returned for each inkexID and this to have most recent dateAdded |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2011-04-05 : 12:08:43
|
Remove 'actionsTaken.dateAdded' from the group by.. and do dateAdded = max(actionsTaken.dateAdded)in the select...Corey I Has Returned!! |
 |
|
|
velnias2010
Posting Yak Master
125 Posts |
Posted - 2011-04-06 : 04:02:34
|
| great thanks that worked |
 |
|
|
|
|
|