fun with years
From: <rogel_at_web.de>
Date: Thu, 30 Dec 2021 19:56:42 +0100
Message-ID: <trinity-c9d12e5a-5a43-430c-95e4-075a5a8ae51a-1640890602873_at_3c-app-webde-bs11>
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Dec 30 2021 - 19:56:42 CET
Date: Thu, 30 Dec 2021 19:56:42 +0100
Message-ID: <trinity-c9d12e5a-5a43-430c-95e4-075a5a8ae51a-1640890602873_at_3c-app-webde-bs11>
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
------------------ ----------
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
------------------ ----------
2021 1
2021 1
Thanks and a Happy New Year !
Matthias