database - Merging SQLite3 tables with identical primary keys -


i trying merge 2 tables financial information same list of stocks: first prices table (containing, daily, weekly, monthly, etc... price data) , second ratios table (containing valuation , other ratios). both tables have identical primary key numerical id columns (referencing same stock tickers). after creating connection cursor cur, code doing is:

create table if not exists prices_n_ratios select * (select * prices inner join ratios on prices.id = ratios.id); drop table prices; drop table ratios; 

this works fine except new prices_n_ratios table contains column named id:1 name causing problems during further processing.

how avoid creation of column, maybe somehow excluding second tables's first primary key id column * (listing column names not option), or if can't, how can rid of column generated table have found hard delete in sqlite3?

just list columns want in select clause, instead of using *.

alternatively, join using clause, automatically removes duplicate column:

select * prices join ratios using (id) 

Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -