SELECT
aff.translationId,
aff.title,
aff.img_icon,
aff.img_icon2
FROM
all_filters_filters aff
WHERE
aff.lang = :lang
AND aff.pid = :pid
AND EXISTS (
SELECT 1
FROM products_colors pc
JOIN all_filters_filters_items affi ON affi.pid = pc.pid_with
WHERE
pc.pid IN (221004, 330498, 420602, 420872, 429634, 195148, 211120, 326798, 519479, 520809, 777184, 778324)
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 = :lang
AND aff.pid = :pid
AND EXISTS (
SELECT 1
FROM products_colors pc
JOIN all_filters_filters_items affi ON affi.pid = pc.pid_with
WHERE
pc.pid IN (221004, 330498, 420602, 420872, 429634, 195148, 211120, 326798, 519479, 520809, 777184, 778324)
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 = :lang
AND aff.pid = :pid
AND EXISTS (
SELECT 1
FROM products_colors pc
JOIN all_filters_filters_items affi ON affi.pid = pc.pid_with
WHERE
pc.pid IN (221004, 330498, 420602, 420872, 429634, 195148, 211120, 326798, 519479, 520809, 777184, 778324)
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 = :lang
AND aff.pid = :pid
AND EXISTS (
SELECT 1
FROM products_colors pc
JOIN all_filters_filters_items affi ON affi.pid = pc.pid_with
WHERE
pc.pid IN (221004, 330498, 420602, 420872, 429634, 195148, 211120, 326798, 519479, 520809, 777184, 778324)
AND affi.fid = aff.translationId
)
ORDER BY
aff.heading_contact ASC;