Answer by Rob Farley for Join two tables and return data and count in a...
select l.email_list_id, l.email_list_name, count(d.email_uniq_id) as full_count, count(case when d.blacklist = 0 then d.email_uniq_id end) as white_count, count(case when d.blacklist = 1 then...
View ArticleAnswer by Bogdan Bogdanov for Join two tables and return data and count in a...
Try something like this:SELECT el.emali_list_name AS EmailList,COUNT(*) AS EmailsCount ,SUM(CASE WHEN ed.blacklist = 1 THEN 1 ELSE 0 END) AS BlackList4ListCouint,SUM(CASE WHEN ed.blacklist = 0 THEN 1...
View ArticleJoin two tables and return data and count in a single query
I have two tables in an SQL Server database, one with two columns and one with four:tbl_email_listemail_list_idint (PK)email_list_namevarchartbl_email-detailsemail_uniq_idint (PK)email_list_idint...
View Article
More Pages to Explore .....