I want to execute this query in SQL Server but it didn’t work :
Select Nom from tab
WHERE
Nom LIKE
CASE WHEN libelle !='' then
Nom1
OR
Nom2
else
Nom3
end
Any help wil be appreciate
UPDATE: Added from OP comment:
I want to verify if libelle not empty nom like nom1 or like nom2 else (if libelle is empty) nom like nom3
I don’t feel that
caseis the right way to go here, so I’m seeing this as more like:To me, this seems simpler to read and understand. The query optimizer might even agree.