I have strange issue. I am working in a Teradata database. In a procedure I am populating a main table by processing data via multiple intermediate tables. But in the end only one table is populating the main table. The syntax is something like this
INSERT INTO sch_1.main_table
(
col1,
col2...
coln
)
SELECT
col1,
col2...
coln
FROM sch_1.work_table;
Now the count(*) from sch_1.work_table results in 112rows whereas its going straight to double in sch_1.main_table i.e. 224 rows.
I am unable to share the logic of the procedure as its for a client. But this thing has me stumped. There are no joins involved in this statement, just a plain and simple insert from a work table to a main table.
Has anyone faced this?