Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using View
Message
De
05/09/2002 05:21:17
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Québec, Canada
 
 
À
05/09/2002 02:46:36
Jeffrey Ang
JGA Software Inc.
Davao, Philippines
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00696981
Message ID:
00696992
Vues:
11
Try this:

CREATE VIEW MySums AS
SELECT SUM(Amount) AS Amount, Code FROM
(SELECT SUM(Amount) AS Amount, Code FROM dbo.A
GROUP BY Code
UNION
SELECT SUM(Amount) AS Amount, Code FROM dbo.B
GROUP BY Code ) a
GROUP BY a.code

HTH,
Christian
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform