· 6 years ago · Jun 17, 2019, 12:22 AM
1CREATE TABLE IF NOT EXISTS table1(v_id, cat TEXT, s1 TEXT,s2 TEXT,s3 TEXT, s4 TEXT,s5 TEXT,s6 TEXT, u_name TEXT, p_date DATE, p_id TEXT)
2
3CREATE TABLE IF NOT EXISTS table2(v_id, cat TEXT, s1 TEXT,s2 TEXT,s3 TEXT, s4 TEXT,s5 TEXT,s6 TEXT, u_name TEXT, p_date DATE, p_id TEXT)
4
5INSERT OR REPLACE INTO table1 SELECT * FROM table2
6LEFT JOIN table1 ON table2.v_id=table1.v_id
7WHERE table2.p_id=table1.p_id OR table1.v_id IS NULL
8
9"table table1 has 11 columns but 22 values were supplied"