SQLite's multi-table connection update

Source: Internet
Author: User
Tags sqlite

Recently processing a large data of the SQLite library, the base table 3 million, the results table 300,000 about, my notebook run up is smooth. Finally, we need two tables to connect and update the results of the other table, but there is a problem. Sqliter does not support common connection updates:

Update a set a.id =b.id from Table_1 a inner joins table_2 B on  a.name=b.name

Check it out, only this:

Update table1 Set col1= (select col1 from table2 where col2=table1.col2)

Try it, it's too slow.

Finally find a way to compromise:

1. Write the connection as a view

2. Export Results to CSV

3. Create an empty table with the same structure and view

4. Import the CSV into the empty table

5. Trimming the related columns

SQLite's multi-table connection update

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.