Welcome Guest ( Log In | Register )


 
 
 
 
 
 

 
 
Oracle 

Performance Tuning Reference poster
 
Oracle training in Linux 

commands
 
Oracle training Weblogic Book
 
Easy Oracle Jumpstart
 
Oracle training & performance tuning books
 
Burleson Consulting Remote DB Administration
 
 
 
Reply to this topicStart new topic
> NVL2 function, need to display empid
thiyagusham
post Mar 27 2012, 10:40 PM
Post #1


Advanced Member
***

Group: Members
Posts: 78
Joined: 16-March 12
From: Chennai from India
Member No.: 46,939



SQL> select * from samp;


NAME DOJ QUAL EMPID
---------- --------------- ---------- -----

sam 21-mar-2012 mca
sony 03-jan-2000 mba 10610
maya 21-mar-2012 m.arch
sonna 18-mar-2012 mis

SQL> select name,doj,qual,empid,
2 nvl2('',doj,'new joinee')"RESULT" from samp;

NAME DOJ QUAL EMPID RESULT
---------- --------------- ---------- ----- - -------------
sam 21-mar-2012 mca new joinee
sony 03-jan- 2000 mba 10610 new joinee
maya 21-mar-2012 m.arch new joinee
sonna 18-mar-2012 mis new joinee

i want to display in result column 10610 in second row , because emp sony having id "10610 "
should i use sub-query ? without sub-query how can i display ????
thanks .
Go to the top of the page
 
+Quote Post
Florin Aparaschi...
post Mar 28 2012, 01:53 AM
Post #2


Advanced Member
***

Group: Members
Posts: 52
Joined: 7-February 08
From: Iasi, Romania
Member No.: 17,075



NVL(empid, 'new joinee')
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th July 2014 - 05:58 PM