-- Create a temporary table and merge the records of the two tables into the temporary table
Use yyu0315
Drop table # Table
Select Identity (INT, 1, 1) as ID, place, happentime, findtime, endtime, firearea,
Forestarea, injurednum, economical miclosses, usedpnum, usedcarnum, use.pdf, name, job, compensation.pdf,
Fine, seednum, detainedday, arrest, cause, type, note, datatime, county, town, village into # table from
(Select
R. ID,
R. Place,
R. happentime,
R. findtime,
R. endtime,
R. firearea,
R. forestarea,
R. injurednum,
R. Economic miclosses,
R. usedpnum,
R. usedcarnum,
R. use.pdf,
R. Name,
R. Job,
R. compensation.pdf,
R. Fine,
R. seednum,
R. detainedday,
R. Arrest,
R. Cause,
R. type,
R. Note,
R. datatime,
R. County,
R. Town,
R. Village
From h_fhistoryrecord R
Union all
Select
T. ID,
T. Place,
T. happentime,
T. findtime,
T. endtime,
T. firearea,
T. forestarea,
T. injurednum,
T. economiclosses,
T. usedpnum,
T. usedcarnum,
T. use.pdf,
T. Name,
T. Job,
T. compensation.pdf,
T. Fine,
T. seednum,
T. detainedday,
T. Arrest,
T. Cause,
T. type,
T. Note,
T. datatime,
T. County,
T. Town,
T. Village
From fhistoryrecord_temp $ T)
As S
Select * from # Table
-- Create a temp table with the same structure and content as the temporary table
Select * into temp from # Table
Select * from temp;