|
INTERVIEW QUESTIONS
ORACLE
SQL PLUS
DETAILS
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
Answer: 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;
|
|
|
Category |
SQL Plus Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8548 users |
Added on |
8/7/2011 |
Views |
72629 |
Rate it! |
|
|
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
Answer:
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; Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All SQL Plus Interview Questions & Answers - Exam Mode /
Learning Mode
|