Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
SQL Server 119
#SQLServer 88
Oracle 70
#SQL SERVER 35
BRH 31
SQL Server 2012 29
denali 23
#TSQL 19
TSQL 19
C# 15

Archive · View All
October 2011 31
November 2011 30
September 2011 30
August 2011 18
December 2011 15
July 2011 13
June 2011 8
May 2012 4
April 2012 3
January 2010 3

Day 12: NVL function in Oracle

Sep 25 2011 11:36PM by Niladri Biswas   

Let Us Learn Oracle - Part 12 of N [ NVL function in Oracle ]

Source table: tblPlayers

Purpose: It substitute a value when a null value is encountered.

Syntax: NVL( ColumnName, ReplaceValue )

Where,

ColumnName => It is the column that is use for null value test.

ReplaceValue => Value that will be substituted if column value is null

For the sake of illustration we have inserted one record where the Fee PerMatch is null.

Insert into tblplayers(PLAYERID,PLAYERFIRSTNAME,PLAYERLASTNAME,BELONGSTO,DOB,FEEPERMATCH)  Values(11,'P','Chopra','India',To_Date('14/02/1998','DD/MM/YYYY'),Null);

Now run the query


SQL> Select  PLAYERID,Concat(PLAYERFIRSTNAME,Concat(' ' , PLAYERLASTNAME)) PlayerName,NVL(FEEPERMATCH,55) From tblplayers Order By PLAYERID;

  PLAYERID PLAYERNAME            NVL(FEEPERMATCH,55)
---------- --------------------- -------------------
         1 A Raman                              2000
         2 B Kadir                              1000
         3 C Nadir                              3000
         4 D Das                                 500
         5 E Punchkar                          12000
         6 F Fateman                           22000
         7 G Gajani                              999
         8 H Hariharan                          7000
         9 I Ikat                               5999
        10 J Jwar                               7900
        11 P Chopra                               55

11 rows selected.

We can make out that for PlayerId 11, the value for FeePerMatch has been replaced by 55.

In Sql Server, we implement this functionality by using either Coalesce, or Null IF, Or Case statement, Or IIF (in Denali).

Thanks for reading.

Tags: #SQLServer, SQL Server, Oracle,


Niladri Biswas
7 · 21% · 6710
2
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

1  Comments  

  • In SQL Server NULLIF is used to compare 2 values but not to substitute the second value if first value is null. Coalesce and ISNULL functions are equivalent functions in sql server for NVL function in Oracle

    commented on Jan 9 2012 5:38PM
    prathap reddy
    1443 · 0% · 14

Your Comment


Sign Up or Login to post a comment.

"Day 12: NVL function in Oracle" rated 5 out of 5 by 2 readers
Day 12: NVL function in Oracle , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]