简体   繁体   中英

joining two table in sqlite

i have two table 表1数据 and table two data is 表2

and i want to show just like this

表3

I have to make a table out of two other tables one table with column word and serial and another with column meaning and serial .

Now what I have to do is put this result(data) into table3 (a table i already have, with the same columns as in table1 and (table2) tried lots but can't please help me I hope this isn't too confusing of a question.

select
  a.serial,
  b.word,
  a.word as meaning
from  tbl1 a
join tbl2 b on a.serial = b.serial

This is the sql query your looking for ,details related to the same is been provided in the link below

INSERT INTO table3 (serial,word,meaning)
SELECT t1.serial,t2.word,t1.word 
FROM table1 as t1 
JOIN table2 as t2 ON t1.serial=t2.serial

click here w3schools SQL tutorial

尝试

select * from eng join other on eng.serial=other.serial

You can try something like:

INSERT INTO table (col_a, col_b) SELECT col_a, col_b FROM table_b JOIN table_c ON [argument] 

I'm not in my PC right now, so I can't make any elaborated code...

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