1

I trying to set a nvl() with the value OPEN on ->

        select to_char(max(CLOSE_DATE),'dd.mm.yyyy hh24:mi:ss') 

If it is closed is getting the date ('dd.mm.yyyy hh24:mi:ss') otherwise it should display OPEN

Any ideas, where I can put correctly the NVL()?

Solution:

        select nvl (to_char(max(CLOSE_DATE),'dd.mm.yyyy hh24:mi:ss'), 'OPEN')

4

1 回答 1

2

这个?

select decode(close_date, null, 'OPEN', 
                                to_char(close_date, 'dd.mm.yyyy hh24:mi:ss'
             ) result
from your_table

或者

select nvl(to_char(close_date, 'dd.mm.yyyy hh24:mi:ss'), 'OPEN') result
from your_table
于 2018-04-20T20:37:38.990 回答