Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Insert statement does not insert all records as shown by select statement

592323Oct 17 2007 — edited Oct 18 2007
Hi

I have a problem where the insert statement is not inserting all the records as shown by the select statement.

For example,if i use the select statement like this to query the number of records
SELECT COUNT(*) FROM
(
SELECT * from tablename1
JOIN tablename2 a
ON condition
JOIN tablename2 b
ON condition AND condition
WHERE date >= (trunc(sysdate) - 10)
AND condition AND condition
AND condition
AND condition
GROUP BY columns)

It returns some 500 records and later when i use the insert statement like this

BEGIN
INSERT INTO tablename (columns)
(SELECT * from tablename1
JOIN tablename2 a
ON condition
JOIN tablename2 b
ON condition AND condition
WHERE date >= (trunc(sysdate) - 10)
AND condition AND condition
AND condition
AND condition
GROUP BY columns);
END;

This gives me less number of records than that are showing by the select statement.Can any one help me in this
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 15 2007
Added on Oct 17 2007
8 comments
1,199 views