I'm using SQL Server 2012.
I have two tables and I'm trying to see how many rows both tables contain. They have no common field on which they can join. Below is my query so far, which obviously doesn't work. How should it be?
;with tblOne as
(
select count(*) numRows from tblOne where DateEx = '2015-10-27'
),
tblTwo as
(
select count(*) numRows from tblTwo where Status = 0
)
select tblOne.numRows + tblTwo.numRows
SELECT t1.numRows + t2.numRows FROM tblOne t1 CROSS JOIN tblTwo t2