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
Go To First  |  Previous Question  |  Next Question 
 SQL Plus  |  Question 36 of 130    Print  
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

  
Total Answers and Comments: 3 Last Update: June 16, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 27, 2005 17:50:09   #1  
Satyavani        

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

 
Is this answer useful? Yes | No
December 20, 2007 02:01:23   #2  
ora.nachs Member Since: January 2007   Contribution: 9    

RE: 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 que
SELECT NVL (To_Char(comm), 'Not Applicable') FROM emp
 
Is this answer useful? Yes | No
June 16, 2008 12:12:07   #3  
Dr. Codd Member Since: June 2008   Contribution: 2    

RE: 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 que
If "comm" is zero then the above query will give wrong result.
Query should be

SELECT NVL (To_Char(comm), 'Not Applicable') FROM table_name;

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape