1)
DECODE is a subset of CASE. We had DECODE a long time before we introduced the CASE function, which is why a lot of people are more familiar with DECODE.
DECODE only "looks" at one thing, the first argument:
DECODE([the thing I'm looking at], [then the possible values])
whereas CASE could have many things to consider,
CASE
WHEN x=1 THEN
WHEN z+y < sysdate THEN
etc etc
2) HAVING is a where clause applied to an aggregation, for exmaple
select dept, count(*)
from emp
group by dept
I dont *know* the value of 'count(*)' until *after* I have done the group-by, so I can either do:
select dept, count(*)
from emp
group by dept
HAVING count(*) > 10
or
select *
from (
select dept, count(*) c
from emp
group by dept
)
where c > 10
3)
http://www.oracle.com/technetwork/issue-archive/2016/16-jan/o16sql201-2882217.html http://www.oracle.com/technetwork/issue-archive/2016/16-mar/o26sql201-2952436.html