Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT COUNT(*) with UNION
Message
 
 
To
02/01/2013 21:50:27
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01561145
Message ID:
01561159
Views:
54
>>
>>select sum(cntTotal) as Total
>>FROM
>>(select count(..) as cntTotal from myFirstTable ...
>>UNION ALL
>>select count(..) as cntTotal from  mySecondTable) X
>
>Thanks
>
>That's what I used but did not include the ALL.

UNION without ALL will do a distinct select. For your case most likely you need UNION ALL.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform