SELECT O.Id
FROM Orders O
JOIN Order_details OD ON O.Id=OD.Order_Id
WHERE O.Status='OK'
GROUP BY O.Id
HAVING count(DISTINCT OD.Id)>1
AND SUM(CASE WHEN OD.Status NOT IN ('S1','S2')
THEN 1
ELSE 0
END) = 0
SELECT O.Id
FROM Orders O
JOIN Order_details OD ON O.Id=OD.Order_Id
WHERE O.Status='OK'
GROUP BY O.Id
HAVING count(DISTINCT OD.Id)>1
AND SUM(CASE WHEN OD.Status NOT IN ('S1','S2')
THEN 1
ELSE 0
END) = 0
Comment activer toutes les contraintes de vérification dans la base de données SQL Server - Tutoriel SQL Server / TSQL Partie 88
Comment installer MySQL 8 sur Ubuntu
Oracle ne fait pas la distinction entre les valeurs nulles et les chaînes vides ?
Comment installer Oracle SQL Developer 18.2 sur Windows 10 ?