P
P
pon4ik4002019-10-03 10:48:43
MySQL
pon4ik400, 2019-10-03 10:48:43

How to select data across multiple fields in join with matching?

Good afternoon, the question in the following is 2 tables #_users with 17 fields and a table #_content with 32 fields the essence of the question in the following is to select only id and username from the table #_users and from the table #_content select 2 fields title, created_by then match their user from the #_users table and the material placed from the #_content table, the title field title and created_by are written with the user id.
solved it like this:

select * from #_users INNER JOIN #_content using(created_by);

Under this condition, the comparison works user + material, but both tables are displayed completely with all fields.
Tried doing the following but didn't work:
select id, username, created_by from #_users INNER JOIN #_content using(created_by);

Thanks in advance for your reply!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Pavlov, 2019-10-03
@I_Pavlov

select #_users.id, #_users.username, #_content.title, #_content.created_by from #_users INNER JOIN #_content using(created_by);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question