Why IsNull(LTrim(RTrim(Lower(null))), -1) is *?

Viewed 6072

Today I was testing something at work place and came across this one

Case 1:

Declare @a nvarchar(20)
Set @a = null
Select IsNull(LTrim(RTrim(Lower(@a))), -1)

Case 2:

Select IsNull(LTrim(RTrim(Lower(null))), -1)

The result in case 1 is -1 but * in case 2 I was expecting same results in both cases. Any reason?

3 Answers
Related