Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create A Running Total In A Query
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01327963
Message ID:
01328067
Vues:
19
>I can't get this running total query to work.
>
>
>SELECT	OrderId,
>		UnitPrice,
>		Quantity,
>		UnitPrice * Quantity AS RowAmt,
>		(SELECT SUM(UnitPrice * Quantity) AS RunningTot
>			FROM [Order Details]
>			WHERE OrderId = o.OrderId)
>	FROM [Order Details] o
>
>
>I get "Incorrect syntax near the keyword 'FROM'." on the inner query.
>
>

You're just missing one parens. I corrected inline.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform