Monday, June 16, 2008

Let's Talk about .. SQL Server 2005-Count the number of items from many sets of select

P'Beer told me yesterday about how to find out the number of all items (from many selects). This is the solution.

[SQL]
select count(*)
from(select .......)
UNION(select .......) Table_Name

Note: you've to specify the Name (Table_Name) after the last select.

No comments: