NVL functionality

select NVL(B.SEQID, A.LVL5_ID) LVL6_ID, NVL(B.NAME, ' ')  LVL6_NAME, A.LVL5_ID
FROM LVL5 A, ABC B WHERE A.LVL5_ID = B.LVL7

The above query is what defines the view in my system. Here I would like to know why NVL was used.

The fact is that the SEQID is a primary key column and cannot be null. Is NVL needed here?

B.SEQID can be null if no records matching the where clause can be found (I know this doesn't make sense, but I just had to ask)

+3
source share
2 answers

What your nvl function does is it replaces all the null values ​​it encounters in B.SEQID with the value A.LVL5_ID.

, B.SEQID , NVL , . .

where , , " ", .

+3

- . , , . , NVL.

,
.

+1

All Articles