0

I'm having problem in inserting into table. I'm inserting data from one table into another

insert into table1 select * from table2 where condition = expression

I have 962 records in table2 for specified condition, but only 105 rows are getting inserted.

Both tables are in same database.

What could be problem? Please help me to get out of this problem.

3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by Vote4WillFree
0

I'm having problem in inserting into table. I'm inserting data from one table into another

insert into table1 select * from table2 where condition = expression

I have 962 records in table2 for specified condition, but only 105 rows are getting inserted.

Both tables are in same database.

What could be problem? Please help me to get out of this problem.

your expression is probably wrong, however, it is difficult to diagnose unless you post it and some of your schema

0

The insertion sql statement should be something like:

INSERT INTO TABLE (column1, column2)
SELECT column1, column2 FROM TABLE2 WHERE column3 = 4

make sure that the number of columns are the same and in the same order

Hope it helps.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.