Hello, im trying to extract and merge data from several tables into one
table, to indetify which table each row of data has come from I would like to
insert a column which references the table name. Below is an example of the
code:-
I would like to create a column which will show for example
'summed_corp_tin_t_20041115' next to its respective data. Please help!
SELECT summed_corp_tin_t_20041115.record_type,
summed_corp_tin_t_20041115.payment_type,
(SUM (summed_corp_tin_t_20041115.COUNT)) sum_count,
(SUM (summed_corp_tin_t_20041115.tran_amount)) sum_amount
FROM summed_corp_tin_t_20041115
GROUP BY summed_corp_tin_t_20041115.record_type,
summed_corp_tin_t_20041115.payment_type
UNION
SELECT summed_corp_tin_t_20041018.record_type,
summed_corp_tin_t_20041018.payment_type,
(SUM (summed_corp_tin_t_20041018.COUNT)) sum_count,
(SUM (summed_corp_tin_t_20041018.tran_amount)) sum_amount
FROM summed_corp_tin_t_20041018
GROUP BY summed_corp_tin_t_20041018.record_type,
summed_corp_tin_t_20041018.payment_type
Any help much appreciated.
Thanks
Brian
Manchester, England
Jacco Schalkwijk - 07 Dec 2004 14:27 GMT
Your question has been answered in the .programming newsgroup.Please don't
multipost.

Signature
Jacco Schalkwijk
SQL Server MVP
> Hello, im trying to extract and merge data from several tables into one
> table, to indetify which table each row of data has come from I would like
[quoted text clipped - 27 lines]
> Brian
> Manchester, England