|
-
SQL insert msg differs from row count
Greetings
I have an SQL script that does an INSERT using a SELECT statement. The SQL statement has the form:
insert into new_table
select a1, a2, a3
from old_table1 t1,
(select b1, sum(b2), avg(b3)
from old_table2
where b4 = 1
and b2 > 0
group by b1) iv1
where t1.a1 = iv1.b1
and a2 > 0;
When the script runs, it returns the message:
151200 rows created.
When I do a 'select count(*) from new_table' it returns:
27500 rows selected.
The table was empty when I started.
Where did the 'missing' rows go?
What is the 'rows created' message really reflecting? Is it counting rows in the TEMP table or what?
The 27500 is about the number of rows I expected.
Any ideas are welcome.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|