Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Incorrect Syntax Error
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01323625
Message ID:
01323627
Vues:
17
How nice. Thanks Sergey!



>SQL Server is very particular about clauses order. The ORDER BY has to be after the GROUP BY.
>
>>I'm getting "Incorrect syntax near the keyword 'GROUP'."
>>
>>
>>
>>SELECT  d.sDepository_Desc,
>>	c.sCommodity_Desc,
>>	p.sProduct_CD,
>>        p.sProduct_Desc1,
>>        i.decInv_Physical_Qty,
>>        p.decProduct_Ozconv,
>>        i.decInv_Physical_Qty * p.decProduct_Ozconv AS Ounces
>>	FROM Product p
>>	JOIN Inventory i on i.sProduct_CD = p.sProduct_CD
>>	JOIN Commodity c on c.sCommodity_CD = p.sCommodity_CD
>>	JOIN Depository d on d.sDepository_CD = i.sDepository_CD
>>	ORDER BY i.sProduct_Cd, c.sCommodity_CD, p.sProduct_CD
>>	GROUP BY d.sDepository_Desc, c.sCommodity_Desc, p.sProduct_CD
>>
>>
>>
>>This runs fine if I remove the GROUP BY clause
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform