Yes, you can do it :-)
create List with table names
List<string> Tables = new List<string>();
Tables.Add("Table1");
Tables.Add("Table2");
And build your SQL statement like below
string sql = string.Join( " UNION ", Tables.Select(t=> string.Format("SELECT '{0}' AS Table, SUM(a) - SUM(b) AS Result FROM {0}", t)));
Done :-)