Answer the question
In order to leave comments, you need to log in
How to get information by ID from another table in one query?
Hello!
I can't figure out how to make a request.
Conventionally, there are two tables:
`products`, with columns: `id`, `title` (product name), `buyer_id` (customer ID, from the `buyers` table)
`buyers`, with columns: `id`, ` name` (customer's name)
The task is simple:
Get in one query as a result a table that has the following columns: `Product ID`, `Product name`, `Customer name`
What will it look like?
Answer the question
In order to leave comments, you need to log in
Select p.id, p.title,b.name
From products p
Join buyers b ON p.buyer_id = b.id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question