SELECT *
FROM video
INNER JOIN category ON video.category1
OR video.category2 = category.id
WHERE video.id = 100
SELECT *
FROM video
INNER JOIN video AS video_main ON video.category1 = video_main.category1 AND video.category2 = video_main.category2
WHERE video_main.id = 100
SELECT *
FROM video
INNER JOIN video AS video_main ON video.category1 = video_main.category1 OR video.category2 = video_main.category2
WHERE video_main.id = 100
Запрос должен доставать видео у которых category1 и category2 совпадает с категорией видео у которого id=100, типа похожие видео
SELECT
`video`.*
FROM `video`
WHERE
(
`video`.`category1` IN (SELECT category1 FROM `video` WHERE `id`='1' UNION SELECT category2 FROM `video` WHERE `id`='1')
OR `video`.`category2` IN (SELECT category1 FROM `video` WHERE `id`='1' UNION SELECT category2 FROM `video` WHERE `id`='1')
)
AND `video`.`id` != '1'