Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I want to join user table with log table twice

user table:

id = 1
name = David,
id= 2
name = Jhon

log table:

user_id = 1
guest_id = 2 

wanted output

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

user_name = David
guest_name = Jhon

>Solution :

SELECT T.NAME,T2.NAME
FROM LOG_TABLE L
JOIN USER_TABLE T ON L.USER_ID=T.ID
JOIN USER_TABLE T2 ON L.guest_id =T2.ID

You can use something like this

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading