Group functions ignore NULL values by default. To force Oracle group functions not to ignore NULL values use nvl() function.
For example:
select avg(sal) from emp;
AVG(SAL)
----------------
29333.3333333333
select avg(nvl(sal,0)) from emp;
AVG(NLV(SAL,0))
--------------------
17600
In this example some of the employees where updated with salary of NULL.
Now try another example to understand the GROUP BY clause also ignores the NULL.
select sal, sum(sal) from emp group by sal;
SAL SUM(SAL)
------------------
25000 25000
27000 27000
36000 36000
Four rows selected.
Even though there where two NULL in the sal field, only one row was yielded by GROUP BY clause.
2 comments:
Wow that was unuѕual. І juѕt wrοtе аn νeгy long cοmment but after I clicκed submit my commеnt didn't appear. Grrrr... well I'm not writing all that over agaіn.
Аnywaуs, just wanted to say grеat blоg!
my weblog Learn Additional Here
air jordans
burberry outlet online
michael kors outlet online
michael kors handbags
coach outlet
timberland boots
louis vuitton handbags
basketball shoes
cheap oakley sunglasses
nike store
louis vuitton handbags
michael kors outlet online
nike nfl jerseys
coach factory outlet
nike air force 1
fake watches
ed hardy clothing
tiffany jewelry
louis vuitton outlet
air jordan pas cher
cheap oakley sunglasses
jordan shoes
christian louboutin outlet
celine handbags
christian louboutin outlet
adidas shoes
oakley outlet
ray ban sunglasses outlet
louis vuitton outlet
ray ban sunglasses
coach outlet
nike air max 90
coach factory outlet
cheap toms shoes
timberland outlet
coach outlet
jordans
ralph lauren polo
coach outlet
jordan 4 toro
20166.4wengdongdong
Post a Comment