What is the difference between nvl (sum (field), 0) & sum (nvl (field, 0))?

What is the difference between nvl (sum (field), 0) & sum (nvl (field, 0))?

For the data in the table below I don't see that in the results

CREATE TABLE FRUITS
(
TYPE VARCHAR2 (10 BYTE),
VARIETY VARCHAR2 (10 BYTE),
PRICE NUMBER (18.2)
)

VARIETY OF TYPE PRICE

Gala Apple 2.79
Apple fuji 0.24
Apple limbertwig 2.87
Orange valencia 3.59
9.36 navel Orange
7.77 bradford PEAR
7.77 bartlett PEAR
Cherry bing 2.55
Cherry Chelan 6.33
Bradford PEAR
navel 6.39


Choose the variety, nvl (sum (price), 0)
fruit
Group of variety;


VARIETY NVL (SUM (PRICE), 0)

limbertwig 2.87
Bartlett 7.77
Bing 2.55
0 Marathon
Gala 2.79
Fuji 0.24
navel 15.75
Bradford 7.77
Chelan 6.33
Valencia 3.59


Choose the variety, sum (nvl(price,0))
fruit
Group of variety;

VARIETY SUM (NVL(PRICE,0))

limbertwig 2.87
Bartlett 7.77
Bing 2.55
0 Marathon
Gala 2.79
Fuji 0.24
navel 15.75
Bradford 7.77
Chelan 6.33
Valencia 3.59


no difference in the output.

What is the difference?

Thanks in advance

Do you see the difference now?

PRAZY@11gR1> create table testing(field number);

Table created.

Elapsed: 00:00:00.10
PRAZY@11gR1> insert into testing select null from dual connect by level<=5;

5 rows created.

Elapsed: 00:00:00.00
PRAZY@11gR1> select * from testing;

     FIELD
----------

Elapsed: 00:00:00.01
PRAZY@11gR1> select sum(nvl(field,1)) from testing;

SUM(NVL(FIELD,1))
-----------------
                5

Elapsed: 00:00:00.00
PRAZY@11gR1> select nvl(sum(field),1) from testing;

NVL(SUM(FIELD),1)
-----------------
                1

Elapsed: 00:00:00.00

In the first case, we are substituting 1 to null and synthesis. as a result, we had 5. in the latest, we are summarizing the value null, which is null and its replacement by 1 if the result is null. We have 1.

Kind regards
Prazy

Tags: Database

Similar Questions

  • What is the difference between using Global or an initiative called when you configure custom or user-defined fields?

    What is the difference between using global or initiative when setting custom fields?
    If you have or are never going to have multiple initiatives, him setting the Global causes all initiatives for this area.  If you start by choosing the initiative or initiatives that you want to use this area (the recommended way to go), you have choices later if you add another initiative.  I always go to the initiative, and then it can be added to the new initiative that I wanted.
  • What is the difference between the field blur and Gaussian blur?

    What is the difference between the field blur and Gaussian blur?

    The basic differences are that blur the line field the way a camera lens would be "fuzzy" your image (in fact, it puts a grey area), and the blur of the field has the tools to help to accentuate how the lens captures the reflective light. Gaussian Blur is more than a fuzzy set, or softening of all pixels.

    The following example illustrates the blur field making specular white areas and Gaussian blur, making all the pixels that are just as soft.

    I highly recommend to take a look at these links as well:

    (1) an overview of the new CS6 blur tools. VIDEO: Blur of the field is around 05:30 mark.

    2) a basic understanding of Gaussian blur

  • (1) now I use Lightrom 5.7 How to level 6 or CC? (2) what is the difference between the 6 and CC vercion? (3) when I used lightromm 3, inEXIF the distance in metres to the object that I took, in the virsions later that the function has disappeared, I coul

    (1) now I use Lightrom 5.7 How to level 6 or CC?

    (2) what is the difference between the 6 and CC version?

    (3) when I used lightromm 3, I could see in EXIF distance in metres to the object that I took, in the virsions later that the function is missing, it is very sad I am stiil waiting and I hope it would be possibble in new versions. Or this indication may possible by setting?

    (1) now I use Lightrom 5.7 How to level 6 or CC?

    Buy the standalone update from here: products

    Download CC version here: Adobe explore desktop apps | Adobe Creative Cloud

    (2) what is the difference between the 6 and CC version?

    See this comparison chart: Lightroom compare versions. Adobe Photoshop Lightroom CC

    (3) when I used lightromm 3, I could see in EXIF distance in metres to the object that I took, in the virsions later that the function is missing, it is very sad I am stiil waiting and I hope it would be possibble in new versions. Or this indication may possible by setting?

    Plugin ExifMeta of Rob Cole displays the distance between the subject field (and much more).  Unfortunately, his Web site seems to be down again.  He has been very active here, but he has not posted in several months.

  • What is the difference between Pro Acrobat and LiveCycle Designer 8.1ES?

    Hello

    What is the difference between Pro Acrobat and LiveCycle Designer 8.1ES?

    Thank you

    Hello

    They are two different programs.

    Acrobat

    This can be used to generate other types of document native PDF files. In addition, you can create forms that are called AcroForms. These retain most of the functionality that looks like in Acrobat to comment on.

    The form IS a PDF file.

    Acrobat is avialable for Windows and Mac.

    LiveCycle Designer

    This program is used to develop forms and is completely separate from Acrobat. The forms are called XFA forms, which means XML Forms Acrhitecture. The focus is quite the processing of data.

    While the forms that are created in the designer of the LC can be opened in Acrobat (Reader), they are not native PDF files and some of the features normally is not available. For example, while you can add data to the fields when the form is opened in Acrobat, you can not change the form itself in Acrobat. If you want to change the form, you will need to open again in LC Designer.

    It comes with the Windows of Acrobat Pro version. There isn't a Mac version of LC Designer.

    It's a broad overview brush, it could be useful.

    Niall

  • What is the difference between is and in

    Hi all
    If I have these queries
    1. Select ename from emp where ename in (select ename emp where empno = 10)

    and

    2 - Select ename from emp where exists (select ename emp where empno = 10)

    What is the difference between the two is that only when I use to I put the name of the field or... I mean in queries complex SQL is he will give the same answer

    Thank you

    I think that you wanted to write exists it in the form:

    select ename from emp a where exists ( select 'x' from emp where empno=10 and a.ename = ename)
    

    It is I have provided above and clause will produce the same results.

    Education with it is that you had will to produce a completely different outcome at trial with the in clause.

  • What is the difference between a Apple Watch Series II and the Nike Apple Watch?

    I am interested in buying an Apple Watch, but I don't really understand what are the difference between the two.

    Hello

    Information about the models of series 2 Apple Watch (including Apple Watch Nike +) are available here:

    https://www.Apple.com/watch/

  • What is the difference between an icon of hard drive on my desktop and a home icon in the Finder?

    Hello

    I'm confused about the icon I have on my desk (hard drive) and a picture of a house in the Finder.  My iMac is divided between two discs?   What is the difference between these two, if any?

    the House is your account, which is located ON your hard disk, but it is NOT your hard drive.

  • What is the difference between the cookies keep until I close firefox and the history of cookie empty closing firefox?

    In the settings of Firefox 33.0 (I use Ubuntu 14.04, but the functionality is the same for Windows 7) there are two ways to delete cookies when firefox closes. Or at least, there seems to be.

    Is first the cookies keep until firefox is closed

    Second is to check the box for clear history of firefox closing and in the settings check cookies.

    What is the difference between these two options?

    I usually have two configuration but I noticed that a connection was not save for td canada trust EasyWeb, even though I have an exception set for it. Now I unchecked to remove cookies by disabling the history on close and connection records correctly.

    This connection allows to save 7 cookes under easyweb.td.com and 10 cookies under td.com and I have exceptions defined for both. If I clear the history when closing and include cookies, half of the td.com cookies disappeared when I close firefox and re - open. The same is true if I'm not the exception.

    So currently I can't find a way to keep all cookies if I clear the cookie history when firefox closes. What is the difference with this option?

    When you change the default cookie 'to life' of "keep until: they expire" to "keep until the: I close Firefox", Firefox changes all persistent cookies that sites set session cookies. To allow a site to place a persistent cookie, you need to make an exception (site permission).

    When you turn on the story to stop compensation and include cookies, running a completely separate process that doesn't doesn't pay attention to the duration of cookie or exceptions (permissions site). There just nukes all.

    Note that some cookies could survive if they are encoded in the history file of your session of compensation at the stop, a Firefox uses to restore your tabs and windows from last session. I have not tested.

  • What is the difference between id and apple itunes password

    What is the difference between an apple and a iTunes

    ID and how do I get a password manager to deal with them?

    They are usually the same thing

  • What is the difference between extensions and Plugins and Add-ons?

    I'm sorry if here is not the right place for this post.

    What is the difference between extensions and Plugins and Add-ons? Apparantely, they differ in some sense or aspect, but I do not know how. Please, if it is not too complicated, explain in detail and simple language. Thanks in advance to 1 million.

    Kind regards
    Danesh

    Hi Danesh,

    You should take a look at this article for an explanation. Plugins and extensions are essentially types of Add-ons as well as of the characters and themes.

    Hope this helps!

  • What is the difference between Firefox and Namoroka 64-bit? I have a 64-bit computer. Which should I use?

    What is the difference between Firefox and Namoroka 64-bit?
    I have a 64-bit computer. Which should I use?

    The officially supported only is Firefox - which is your best choice, unless you want to test the new features...

    http://www.Mozilla.org/en-us/Firefox/new/

  • What is the difference between the Service Station and Tempro?

    Searched for information on this, but have not been able to find:

    What is the difference between the Service Station and Tempro?

    I just run the wizard upgrade Toshiba and it installed the gas station but Tempro is already installed and seems to do the same.

    Concerning

    Bushy

    Hello

    These two tools are Toshiba one informs you of the new driver updates available on the Toshiba driver page.

    AFAIK Tempro is slightly older than the gas station.
    In addition the gas station seems to provide a bit more options and features like tool Tempro.
    However, I recommend using one my favorite utility's Service Station

  • What is the difference between sharing and family home page?

    Yesterday I bought a new iMac. I discovered that I had 5 authorized computers when I tried to configure it. I found myself meet my MacBook Pro, which I will give my child once I'm done transferring data, in order to allow the new Mac.

    How can I find out what other Mac my ID Apple is on? Is there another way out remove all to clear the computers I no longer use? What is the difference between the home sharing and family shares anyway?

    Thank you

    Shawn

    Home sharing allows another iTunes (on another computer) to access your library.  If we could watch a movie from your desk at home on your laptop at home.

    All devices must be signed on the same identifier Apple to use the function.

    Family sharing allows different apple ID (family members) to share purchased content.

  • What is the difference between dawn and the beta?

    What is the difference between dawn and the beta?

    Beta is the next version of Firefox that is due to be released in 5 weeks, and Aurora is the one after that--like an Alpha version of development.

Maybe you are looking for

  • Apple TV 4th gen: YouTube is currently unavailable

    BBeen works very well for several months, and then all of a sudden now it won't play. 'YouTube is currently unavailable' greets me whenever I try to use YouTube. I'm not changing anyh

  • Mac glitching out like crazy! (Photos)

    Hello.. I have a very big problem with my mac. I had this before, but restart was enough. Well, I'll show you a picture of my mac. Get ready! So. (His head down in the picture idk why), but it keeps going and my Captain el relocation isn't going one

  • 15 - f233wm: bios password

    I think my kid put a bios password, but he does not remember to do.  I get a black screen with a blue box asking me password administrator or power on password.  When I answer incorrectly 3 times, I get a message indicating the deactivation of the sy

  • HP 450: Is that what this laptop contains chart AMD?

    HelloI recently bought a laptop which the model has been specified as a simple "450 HP".So my question is, my computer contains AMD graphics?I tried to install the AMD driver available on the HP site, but it has not been successful. (only intel HD400

  • Question about Toshiba Bluetooth stack V.4

    Hello We have a laptop Fujitsu Siemens P7120 requiring the Toshiba Bluetooth stack located at http://aps.toshiba-tro.de/Bluetooth/pages/download.php When we install it in silent mode, installation occurs however the Bluetooth does not initialize to t