This discussion is archived
1 Reply Latest reply: Dec 27, 2012 5:35 AM by Jim Smith RSS

about case when and the sql clause

965772 Newbie
Currently Being Moderated
The following is my sql clause:

FROM dbtest1 t
LEFT OUTER JOIN dbtest b ON t.NO = b.empno
WHERE t.ChineseName like '%'||:ChineseName||'%' AND like '%'||:name||'%'
ORDER BY t.ChineseName

The main problem is I hope to check the if it is null it can be passed as NVL function, so I try using case when, but it not working.
When exist in where clause, the result columns will not include the data without implies the is NULL); And that
make the result data not exactly right.
is it possible to use case when to make the following snippet implemented:

case when is not NULL then like '%'||:name||'%'
else = NULL( seems not work to parsing null data)

Thanks a lot.

Edited by: 962769 on 2012/12/26 下午 6:50


  • Correct Answers - 10 points
  • Helpful Answers - 5 points