Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to do this in View.
Message
De
10/07/2003 06:29:04
 
 
À
10/07/2003 05:06:22
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00808770
Message ID:
00808780
Vues:
10
Hi,

I'm useless at SQL and I'm sure there's a simpler way but the following should work:
SELECT tablea.service as totalSalesService,tablea.name from tablea ;
WHERE NOT  tablea.name in (Select tableb.name FROM tableb) ;
UNION ;
Select tableb.sales as total,tableb.name FROM tableb;
WHERE NOT tableb.name in (Select tablea.name FROM tableA);
into CURSOR tmp

SELECT tablea.service+tableb.sales as TotalSalesService,tablea.name;
 FROM tablea INNER join tableb ON tablea.name = tableb.name;
 UNION;
 SELECT * FROM tmp;
 ORDER BY 2
Regards,
Viv
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform