Answer the question
In order to leave comments, you need to log in
How to make a third table using the same column from two tables in SQL?
We have two tables:
title | deposit
----------------
Title 1 | 0.1
Title 2 | 0.2
post_id | title
-----------
1 | Title 1
2 | Title 2
post_id | title | deposit
----------------------
1 | Title 1 | 0.1
2 | Title 2 | 0.2
Answer the question
In order to leave comments, you need to log in
SELECT
table2.post_id as post id,
table2.title as title,
table1.deposit as deposit
FROM table2
LEFT JOIN table1
ON table2.title = table1.title//джойн по тайтлу; в зависимости от вида хранящихся строк возможно стоит делать приведение к нижнему регистру, удаление пробелов и т.д.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question