Follow us: Connect on YouTube Connect on YouTube Connect on YouTube

Pages

Thursday, 31 March 2016

SQL-NVL

This will substitutes the specified value in the place of null values.

     Syntax: nvl (null_col, replacement_value) 

     Ex:
          SQL> select * from student;            -- here for 3rd row marks value is null

                         NO NAME      MARKS
                           --- -------      ---------
                          1        a         100
                          2        b          200
                          3        c

SQL> select no, name, nvl(marks,300) from student; 

                        NO NAME  NVL(MARKS,300)
                         ---  -------  ---------------------
                          1           a             100
                          2           b             200
                          3           c             300

SQL> select nvl(1,2), nvl(2,3), nvl(4,3), nvl(5,4) from dual;

                NVL(1,2)   NVL(2,3)   NVL(4,3)   NVL(5,4)
               ----------    ----------    ----------         ----------
                      1               2                    4                   5

SQL> select nvl(0,0), nvl(1,1), nvl(null,null), nvl(4,4) from dual;

            NVL(0,0)   NVL(1,1) NVL(null,null)  NVL(4,4)
             ----------    ---------- -----------------       ----------

                      0              1                                             4



You May Like                                             
                            SQL Abs
                            SQL Sign
                            SQL Sqrt
                            SQL Mod                           
                            SQL NVL2
                            SQL Power
                            SQL Exp
                            SQL Ln
                            SQL Log
                            SQL CEIL
                            SQL Floor
                            SQL Round
                            SQL Trunc
                            SQL Bitand
                            SQL Greatest
                            SQL Least
                            SQL Coalesce
Share this article :

1 comments:

  1. NayHoh,


    Muchas Gracias Mi Amigo! You make learning so effortless. Anyone can follow you and I would not mind following you to the moon coz I know you are like my north star.

    I changed following configuration file and restart the server .
    C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting
    Services\ReportServer\bin\ReportingServicesService.exe.cofig
    Add following line

    After restart , log generated ReportServerService__04_16_2018_13_58_15.log
    But I saw there is an error as follows
    +++++++++++++++++++++++++++

    Microsoft SQL Server Reporting Services Version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041)
    English (Australia)
    AUS Eastern Standard Time
    L:\Microsoft SQL Server\MSSQL13.MSSQLSERVER\SSRS_TraceDump_log\\ReportServerService__04_16_2018_13_58_15.log
    SQLRST01
    Microsoft Windows NT 6.2.9200
    6.2.9200
    34204
    Hypervisor

    AMD64
    AMD64
    rshost!rshost!5e84!04/16/2018-13:58:15:: i INFO: CLR runtime is initialized.
    rshost!rshost!5e84!04/16/2018-13:58:15:: i INFO: Derived memory configuration based on physical memory as 16776756 KB
    appdomainmanager!DefaultDomain!5e84!04/16/2018-13:58:15:: i INFO: Entered managed ServiceMain in DefaultDomain.


    appdomainmanager!
    DefaultDomain!5e84!04/16/2018-13:58:15:: i INFO: Attempting to start WebApp service: C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer\bin\..\..\RSWebApp\Microsoft.ReportingServices.Portal.WebHost.exe
    library!DefaultDomain!3868!04/16/2018-13:58:16:: i INFO: Initializing ConnectionType to '0' as specified in Configuration file.

    Once again thanks for your tutorial.


    Thank you,
    Ajeeh Kapoor

    ReplyDelete