GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL Plus

 Print  |  
Question:  Display the records between two range I know the nvl function only allows the same data type(ie. number or char or date Nvl(comm, 0)), if commission is null then the text “Not Applicable” want to display, instead of blank space. How do I write the query



July 07, 2005 17:50:09 #1
 Satyavani   Member Since: Visitor    Total Comments: N/A 

RE: Display the records between two range I know the nvl function only allows the same data type(ie. num
 
you can use the decode function for the above requirement. Please find the query as below:  
 
select ename,decode(nvl(comm,0),0,'Not Applicable',comm) from scott.emp; 
 
Thanks, 
satyavani
     

 

Back To Question