Please disregard this messageI think this is something really simple, but for the life of me can't see what I am doing wrong.
I have a table:
ID ForeignKeyID Date
I want to get the maximum date for each foreignKeyId.
When I do this:
SELECT ForeignKeyID, MAX(date)
FROM MyTable
GROUP BY ForeignKeyID
I get this error:
Each GROUP BY expression must contain at least one column that is not an outer reference.
Can someone explain this to a brain dead person, please?
Thanks