Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GROUP BY Outer reference
Message
De
03/07/2013 09:03:15
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
GROUP BY Outer reference
Versions des environnements
SQL Server:
SQL Server 6.5 and older
Application:
Web
Divers
Thread ID:
01577749
Message ID:
01577749
Vues:
42
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
Répondre
Fil
Voir

Click here to load this message in the networking platform