Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ORDER BY in sp?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Divers
Thread ID:
00510084
Message ID:
00510149
Vues:
18
>I have a query that works if I run it from Query Analyzer but is rejected when I try to create a stored procedure with it:
>
>SELECT A.AreaID, B.Zip, C.MedianIncome, C.Total, C.QZip, D.EstimatedQty,
> D.OrderQty
>FROM QZipAreaOrder A JOIN Zipcross B ON A.AreaID=B.AreaID
>LEFT JOIN HouseholdData C ON B.Zip=C.Zip
>LEFT JOIN QZipSelections D ON A.QZipAreaOrderID=D.QZipAreaOrderID
> AND B.Zip=D.Zip
>WHERE A.QZipOrderID=1
> AND A.AreaID=592
>ORDER BY C.MedianIncome DESC
>
>I get an "Incorrect syntax near keyword 'ORDER'" error. What's wrong with this query?

You named A.QZipAreaOrderID or A.QZipOrderID. Are both fields existing or is it a typo?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform