S
S
sunnyrio2018-06-06 11:42:08
MySQL
sunnyrio, 2018-06-06 11:42:08

How to get all the data from table 1 and change the id values ​​to names from table 2?

How to get all the data from table 1, and so that the values ​​(productid) are replaced with names (title) from table 2?
5b179df3eae6a454057650.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
coderisimo, 2018-06-06
@sunnyrio

SELECT  orders.id, products.title  
FROM orders LEFT JOIN products ON (products.id = orders.productid )

here you list everything you need to get - "SELECT orders.id, products.title ..... etc"

R
Rsa97, 2018-06-06
@Rsa97

JOIN

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question