简体   繁体   中英

How do I insert data from table1 to table2?

Table table1 has got 500,000 rows. I want insert only 200,000 of them to table2 from table1 , how do I do it?

INSERT
INTO    table2
SELECT  *
FROM    table1
ORDER BY
        id -- or whatever
LIMIT 200000
INSERT INTO table2
SELECT **TOP 200000** * FROM table1 ORDER BY *<primary key>*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM