Thanks for the question, rd.
Asked: August 09, 2001 - 4:25 pm UTC
Last updated: March 12, 2004 - 5:23 pm UTC
Version: 8.1.5
Viewed 1000+ times
You Asked
Tom
is there any difference between using <> and !=,if so which one is better.
what is the difference between using 'yyyy' and 'rrrr' in the date format for years?
instead of
AND (a.cc_cd IN ('aus','eng','ind') OR b.sec_cc_cd IN ('aus','eng','ind'))
can I do
AND a.cc_cd or b.sec_cc_cd in ('aus','eng','ind')
can you discuss a similar example for me, and illustrate
If the optimizer is set to choose, will the optmizer automatically choose cbo when we use full or first_rows hint, what are the hints which are valid for rbo.
and Tom said...
they are the same <> and !=
one defaults the century, the other does not:
1 select 'yyyy 99', to_char( to_date( '99', 'yyyy' ), 'yyyy' ) from dual
2 union all
3 select 'rrrr 99', to_char( to_date( '99', 'rrrr' ), 'yyyy' ) from dual
4 union all
5 select 'yyyy 01', to_char( to_date( '1', 'yyyy' ), 'yyyy' ) from dual
6 union all
7* select 'rrrr 01', to_char( to_date( '1', 'rrrr' ), 'yyyy' ) from dual
ops$tkyte@ORA817.US.ORACLE.COM> /
'YYYY99 TO_C
------- ----
yyyy 99 0099
rrrr 99 1999
yyyy 01 0001
rrrr 01 2001
ops$tkyte@ORA817.US.ORACLE.COM>
No, you cannot do "a or b in (x,y,z)" instead of "a in (x,y,z) or b in (x,y,z)"
Regardless of the optimizer goal set, if you use a HINT you will be using the CBO -- period.
The only valid "hint" for RBO is /*+ RULE */ -- telling the optimizer to use RBO. There are no hints available for RBO.
Rating
(1 rating)
Is this answer out of date? If it is, please let us know via a Comment