Answer the question
In order to leave comments, you need to log in
How to output 2 values with different names of one table connected by join to another?
There is a table user with fields id, name. There is table1. There are two fields in table1 in the same record with different record ids from the user table.
I want to get data from table1 + name of the first user AS name1 and name of the second user AS name2.
Can you please tell me how this can be implemented?
To get one name, do this
SELECT user.name FROM table1 INNER JOIN user ON table1.id1=user.id
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question