I got a problem with my request.
I want to compare 2 dates, and if the number of days is inferior to 2, i want to display nothing. But if it's over, I want to display the days. I got my request but it failed when I try to compare the DATEDIFF to 2.
SQL> SELECT noLivraison, noCommande, noArticle, dateCommande, quantite, dateLivraison, quantiteLivree,
CASE dateCommande
WHEN DATEDIFF(day, dateLivraison, dateCommande) < 2 THEN null
ELSE DATEDIFF(day, dateLivraison, dateCommande)
END nombreJoursEcoules
FROM Commande
NATURAL JOIN LigneCommande
NATURAL JOIN Livraison
NATURAL JOIN DetailLivraison 2 3 4 5 6 7 8 9
10 /
WHEN DATEDIFF(day, dateLivraison, dateCommande) < 2 THEN null
*
ERROR at line 3:
ORA-00905: missing keyword
I don't know how to fix it, I put more parenthesis but it didn't works.
Ty for reading.