SELECT *
FROM (
    SELECT s_id, id_firm, id_product, MIN(ts) AS ts
    FROM iiabmdb_20250925.without_exp_result
    WHERE `status` = 'D'
      AND ga_id = :ga_id
    GROUP BY s_id, id_firm, id_product
) AS s_disrupt
WHERE s_id IN (
    SELECT s_id
    FROM (
        SELECT s_id, id_firm, id_product, MIN(ts) AS ts
        FROM iiabmdb_20250925.without_exp_result
        WHERE `status` = 'D'
          AND ga_id = :ga_id
        GROUP BY s_id, id_firm, id_product
    ) AS t
    GROUP BY s_id
    HAVING COUNT(*) > 1
)
ORDER BY s_id;
