SELECT
aff.translationId,
aff.title,
aff.img_icon,
aff.img_icon2
FROM
all_filters_filters aff
WHERE
aff.lang = 'uk'
AND aff.pid = 2
AND EXISTS (
SELECT 1
FROM products_colors pc
JOIN all_filters_filters_items affi ON affi.pid = pc.pid_with
WHERE
pc.pid IN (252242, 252244, 252246, 252398, 252400, 252532, 253876, 254116, 254364)
AND affi.fid = aff.translationId
)
ORDER BY
aff.heading_contact ASC;
SELECT
aff.translationId,
aff.title,
aff.img_icon,
aff.img_icon2
FROM
all_filters_filters aff
WHERE
aff.lang = 'uk'
AND aff.pid = 3
AND EXISTS (
SELECT 1
FROM products_colors pc
JOIN all_filters_filters_items affi ON affi.pid = pc.pid_with
WHERE
pc.pid IN (252242, 252244, 252246, 252398, 252400, 252532, 253876, 254116, 254364)
AND affi.fid = aff.translationId
)
ORDER BY
aff.heading_contact ASC;
SELECT
aff.translationId,
aff.title,
aff.img_icon,
aff.img_icon2
FROM
all_filters_filters aff
WHERE
aff.lang = 'uk'
AND aff.pid = 4
AND EXISTS (
SELECT 1
FROM products_colors pc
JOIN all_filters_filters_items affi ON affi.pid = pc.pid_with
WHERE
pc.pid IN (252242, 252244, 252246, 252398, 252400, 252532, 253876, 254116, 254364)
AND affi.fid = aff.translationId
)
ORDER BY
aff.heading_contact ASC;
SELECT
aff.translationId,
aff.title,
aff.img_icon,
aff.img_icon2
FROM
all_filters_filters aff
WHERE
aff.lang = 'uk'
AND aff.pid = 1
AND EXISTS (
SELECT 1
FROM products_colors pc
JOIN all_filters_filters_items affi ON affi.pid = pc.pid_with
WHERE
pc.pid IN (252242, 252244, 252246, 252398, 252400, 252532, 253876, 254116, 254364)
AND affi.fid = aff.translationId
)
ORDER BY
aff.heading_contact ASC;
SELECT
aff.translationId,
aff.title,
aff.img_icon,
aff.img_icon2
FROM
all_filters_filters aff
WHERE
aff.lang = 'uk'
AND aff.pid = 39
AND EXISTS (
SELECT 1
FROM products_colors pc
JOIN all_filters_filters_items affi ON affi.pid = pc.pid_with
WHERE
pc.pid IN (252242, 252244, 252246, 252398, 252400, 252532, 253876, 254116, 254364)
AND affi.fid = aff.translationId
)
ORDER BY
aff.heading_contact ASC;
SELECT
aff.translationId,
aff.title,
aff.img_icon,
aff.img_icon2
FROM
all_filters_filters aff
WHERE
aff.lang = 'uk'
AND aff.pid = 41
AND EXISTS (
SELECT 1
FROM products_colors pc
JOIN all_filters_filters_items affi ON affi.pid = pc.pid_with
WHERE
pc.pid IN (252242, 252244, 252246, 252398, 252400, 252532, 253876, 254116, 254364)
AND affi.fid = aff.translationId
)
ORDER BY
aff.heading_contact ASC;