mysql - How I can do this query? -


i have 2 tables:

table1:

name    added_by     edited_by       1            3 b       2            2 c       3            1 

table2:

id    login 1     admin  2     user1  3     user2 

i need result:

name    added_by     edited_by       admin        user2 b       user1        user1 c       user2        admin 

you can try query

select t1.name,         t2.login added_by,         t3.login edited_by  table1 t1  inner join table2 t2      on(t1.added_by=t2.id)  inner join table2 t3      on(t1.edited_by=t3.id) 

Comments

Popular posts from this blog

go - serving up pdfs using golang -

python - Best design pattern for collection of objects -

how to add preprocess loader in webpack 2 -