sql server - Sum of count of records from different tables group by records' created date -


i using sql server 2008 r2. have 6 tables fetching number of rows grouped created date.

for example :

select count(*) noofreading tablea isdeleted = 0  group convert(varchar(10), createddtutc,111)  select count(*) noofreading tableb isdeleted = 0  group convert(varchar(10), createddtutc,111)  select count(*) noofreading tablec isdeleted = 0  group convert(varchar(10), createddtutc,111) 

and onwards..

now want make sum of noofreading of tables group created date. solution??

p.s. : have tried using "+" between of queries giving error.

thanks

i think simple addition can work..

select (     (select count(*) tablea     isdeleted = 0      group convert(varchar(10), createddtutc,111))     +     (select count(*) tableb     isdeleted = 0      group convert(varchar(10), createddtutc,111))     +     (select count(*) tablec     isdeleted = 0      group convert(varchar(10), createddtutc,111))     )  noofreadingsum 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -