Re: fun with years

From: Tim Gorman <tim.evdbt_at_gmail.com>
Date: Thu, 30 Dec 2021 11:16:52 -0800
Message-ID: <b414f6fb-dc32-49a1-cab8-ebed4337fe17_at_gmail.com>



Oracle Support Document 2629968.1
<https://support.oracle.com/epmos/faces/DocumentDisplay?id=2629968.1> (/Wrong Result Using GROUP BY with EXTRACT Function Against DATE/)

 From the *Solution *section in the note...

    The bug is still being worked on.  Please use one of the workarounds:

        ALTER SESSION SET optimizer_features_enable = '12.1.0.2';
        or
        ALTER SESSION SET "_fix_control" = '23210039:0';
        or
        ALTER SESSION SET "_optimizer_aggr_groupby_elim" = FALSE;





On 12/30/2021 10:56 AM, rogel_at_web.de wrote:
> Dear listers,
> is this a known bug (version is 12.2.0.1) ?
> *SQL> create table t as (select date'2021-12-30' d from dual union all
> select date'2021-12-31' from dual);*
> *Tabelle wurde erstellt.*
> *SQL> select extract(year from d), count(*) from t group by
> extract(year from d);*
> *EXTRACT(YEARFROMD)   COUNT(*)
> ------------------ ----------
>               2021          2*
> *SQL> alter table t add primary key(d);*
> *Tabelle wurde geõndert.*
> *SQL> select extract(year from d), count(*) from t group by
> extract(year from d);*
> *EXTRACT(YEARFROMD)   COUNT(*)
> ------------------ ----------
>               2021          1
>               2021          1*
> Thanks and a Happy New Year !
> Matthias
> -- http://www.freelists.org/webpage/oracle-l

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Dec 30 2021 - 20:16:52 CET

Original text of this message