Saturday, May 5, 2018

Using NVL Function in PLSQL Query

https://randomsrsolutions.blogspot.com/2018/05/using-nvl-function-in-plsql-query.html

select ENAME , COMM, NVL(COMM,0) from EMP
where COMM is not null;

ENAME         COMM        NVL(COMM,0)
ALLEN            300              300
WARD             500              500
MARTIN         1400            1400
TURNER         0                  0


select ENAME, COMM,NVL(COMM,0),  NVL(to_char(COMM), 'NO_COMMISSION') from EMP
where ENAME in ('KING', 'ALLEN', 'SMITH');

ENAME          COMM      NVL(COMM,0)      NVL(to_char(COMM), 'NO_COMMISSION')
KING                 (null)                   0                              NO_COMMISSION
SMITH               (null)                  0                              NO_COMMISSION
ALLEN               300                   300                           300


No comments:

Post a Comment

XLA to GL Link

  https://plsqlquery.blogspot.com/2025/12/xla-to-gl-link.html SELECT             acr.cash_receipt_id,             acr.receipt_number,       ...