Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Views - How do you handle ORDER BY. . .
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00334390
Message ID:
00334633
Vues:
10
Bill,

If you want to pull data from a view in a specific order, specify an ORDER BY clause in the query that references the view:

USE pubs
GO
CREATE VIEW ca_authors AS
SELECT * FROM authors WHERE state = 'CA'
GO
SELECT * FROM ca_authors ORDER BY au_lname

SQL Server will take your query and combine it with the query that makes up the view. The resultant query will then be executed.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform