Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT COUNT(*) with UNION
Message
 
 
À
02/01/2013 21:23:06
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01561145
Message ID:
01561148
Vues:
62
This message has been marked as a message which has helped to the initial question of the thread.
>This page lists some variations on how to accomplish this:
>
>http://stackoverflow.com/questions/1279569/sql-combine-select-count-from-multiple-tables
>
>However, any additional input would be welcome.
select sum(cntTotal) as Total
FROM
(select count(..) as cntTotal from myFirstTable ...
UNION ALL
select count(..) as cntTotal from  mySecondTable) X
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform