There are 2 tables: users and objects . users store id, name, type , etc. In objects , id, user_id , etc. are stored. Question: how to make a selection of all values in the objects table in one objects , where type in users is, for example, 2
Marked as a duplicate by the participants Sergey Gornostaev , aleksandr barakin , Bald , user194374, Alex 27 Dec '16 at 12:40 .
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
|
1 answer
SELECT o.id, o.user_id FROM objects AS o INNER JOIN users AS u ON o.user_id = u.id WHERE u.type = 2 - In this case, the first row in the
objecttable is selected. And how to choose all the lines? - Ruslan - Get out - all. Most likely, you are watching a tool that shows only one record. - Akina
- all figured out! thanks - Ruslan
|
inner joinand where by type = 2 - Mike