SELECT
r.id as req,
ss.id as ss_id,
ss.user_id as user,
min(ss.created_at) AS date
FROM seo_source AS ss
INNER JOIN seo_user_request AS su ON su.user_id = ss.user_id
INNER JOIN request as r ON r.id = su.request_id
GROUP BY ss.id
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
phone='+7(920)523-31-22'
SELECT COUNT(*)
FROM joiners_tourdate
INNER JOIN joiners_country on joiners_tourdate.country_id = joiners_country.id
INNER JOIN joiners_artist on joiners_artist.id = joiners_tourdate.artist_id
WHERE joiners_tourdate.country_id = 3
$dbh->prepare('INSERT INTO `message`(`email_otvet`, `messageh`, `messaget`) VALUES (?, ?, ?)')->execute([
$emailotveta, $messageh, $messaget
]);