Hi there,
apologies in advance: I have a set of data, 3 columns: id, accountid & created date. id is unique, accountid & created date are not unique.
I need to select id, accountid where the created date is the highest/most recent, for each unique group of id and accountid.
I'd like it to be for all accountid's but I've entered ' WHERE accountid = "00120000000DpssAAC" ' for testing purposes. I only need 1 row returned per id and accountid - with the most recent date for those 2 fields? All I get is every single row?
I'm sure its simple
Thank you to anyone that can help
apologies in advance: I have a set of data, 3 columns: id, accountid & created date. id is unique, accountid & created date are not unique.
I need to select id, accountid where the created date is the highest/most recent, for each unique group of id and accountid.
Code:
SELECT id,accountid,CreatedDate
FROM [Task workings 3]
WHERE ((id & accountid & CreatedDate) in (select id & accountid & max(CreatedDate) from [Task workings 3] WHERE accountid = "00120000000DpssAAC" GROUP BY id,accountid,CreatedDate));
I'd like it to be for all accountid's but I've entered ' WHERE accountid = "00120000000DpssAAC" ' for testing purposes. I only need 1 row returned per id and accountid - with the most recent date for those 2 fields? All I get is every single row?
I'm sure its simple
Thank you to anyone that can help