Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GROUP BY Outer reference
Message
From
03/07/2013 09:03:15
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
GROUP BY Outer reference
Environment versions
SQL Server:
SQL Server 6.5 and older
Application:
Web
Miscellaneous
Thread ID:
01577749
Message ID:
01577749
Views:
44
Please disregard this message

I 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
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Reply
Map
View

Click here to load this message in the networking platform