Answer the question
In order to leave comments, you need to log in
How to make such a query in the database?
The essence of the request is as follows: There is a video on the main page, at the bottom of it I make the "Related Videos" block. So, you need to select all videos from the videos table (in this block), but they must be of the same category as the main video. What to do?
The db structure is here:
Answer the question
In order to leave comments, you need to log in
SELECT * FROM videos
WHERE id IN (
SELECT video_id FROM video_category
WHERE category_id=3
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question