.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

Decode function in Oracle

Posted By: Dhivakaran     Posted Date: October 26, 2010    Points:2   Category :Sql Server
What is Decode function in oracle how we can use that function give me some real time example?

Responses
Author: Syed Shakeer Hussain             
Posted Date: October 26, 2010     Points: 5   

Hi,



Check the below link,It contains a Good example.

http://www.techonthenet.com/oracle/functions/decode.php



Author: Deepika Haridas             
Posted Date: October 27, 2010     Points: 5   

Hi,

Decode works the same way as your IF-THEN-ELSE or CASE statement in Oracle.

For example,
If you write a query like
SELECT firstname, salary, empid, DECODE(empid, 'IT_MGR', 1.15*salary, 'CLERK' , 1.20*salary, salary) REVISED_SAL FROM EMP;


then it will result into records having revised salary as per the division for IT_MGR and CLERK based on empid



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend