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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -