<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Daniel,</div> <div> </div> <div>obviously a bug, have you account to MOS to file a bug ?</div> <div>If not, let me know, I will do so.</div> <div> </div> <div>Query 1 gives for me</div> <div> </div> <div> <div><strong><span style="font-size:14px;"><span style="font-family:Courier New,Courier,monospace;">***@12.1 > set autotr traceonly arrays 5000 lines 300 pages 5000 feedb on<br/>
***@12.1 > WITH session_count AS<br/>
2 ( SELECT sample_time, count(1) sess_count<br/>
3 FROM dba_hist_active_sess_history<br/>
4 WHERE sample_time >= TRUNC(sysdate - (1/24))<br/>
5 GROUP BY sample_time<br/>
6 )<br/>
7 SELECT TO_CHAR(sample_time, 'YYYYMMDD hh24:mi') sample_minute,<br/>
8 MAX(sess_count) max_sessions,<br/>
9 count(*) count<br/>
10 FROM session_count<br/>
11 GROUP BY TO_CHAR(sample_time, 'YYYYMMDD hh24:mi')<br/>
12 ORDER BY sample_minute<br/>
13 /</span></span></strong></div>
<div><strong><span style="font-size:14px;"><span style="font-family:Courier New,Courier,monospace;">4812 rows selected.</span></span></strong></div>
<div><br/>
<strong><span style="font-size:14px;"><span style="font-family:Courier New,Courier,monospace;">Execution Plan<br/>
----------------------------------------------------------<br/>
Plan hash value: 2604173274</span></span></strong></div>
<div><strong><span style="font-size:14px;"><span style="font-family:Courier New,Courier,monospace;">------------------------------------------------------------------------------------------------------------------------------<br/>
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |<br/>
------------------------------------------------------------------------------------------------------------------------------<br/>
| 0 | SELECT STATEMENT | | 1 | 64 | 3666 (1)| 00:00:01 | | |<br/>
| 1 | SORT ORDER BY | | 1 | 64 | 3666 (1)| 00:00:01 | | |<br/>
| 2 | HASH GROUP BY | | 1 | 64 | 3666 (1)| 00:00:01 | | |<br/>
| 3 | NESTED LOOPS OUTER | | 1 | 64 | 3664 (1)| 00:00:01 | | |<br/>
| 4 | NESTED LOOPS OUTER | | 1 | 47 | 3663 (1)| 00:00:01 | | |<br/>
| 5 | PARTITION RANGE ALL | | 1 | 33 | 3662 (1)| 00:00:01 | 1 | 6 |<br/>
|* 6 | TABLE ACCESS FULL | WRH$_ACTIVE_SESSION_HISTORY | 1 | 33 | 3662 (1)| 00:00:01 | 1 | 6 |<br/>
|* 7 | INDEX RANGE SCAN | WRH$_EVENT_NAME_PK | 1 | 14 | 1 (0)| 00:00:01 | | |<br/>
|* 8 | TABLE ACCESS BY INDEX ROWID| WRM$_SNAPSHOT | 1 | 17 | 1 (0)| 00:00:01 | | |<br/>
|* 9 | INDEX UNIQUE SCAN | WRM$_SNAPSHOT_PK | 1 | | 0 (0)| 00:00:01 | | |<br/>
------------------------------------------------------------------------------------------------------------------------------</span></span></strong></div>
<div><strong><span style="font-size:14px;"><span style="font-family:Courier New,Courier,monospace;">Predicate Information (identified by operation id):<br/>
---------------------------------------------------</span></span></strong></div> <div><strong><span style="font-size:14px;"><span style="font-family:Courier New,Courier,monospace;"> 6 - filter("ASH"."SAMPLE_TIME">=TRUNC(SYSDATE@!-.0416666666666666666666666666666666666667))<br/>
7 - access("ASH"."DBID"="EVT"."DBID"(+) AND "ASH"."EVENT_ID"="EVT"."EVENT_ID"(+))<br/>
8 - filter("STATUS"(+)=0)<br/>
9 - access("ASH"."DBID"="DBID"(+) AND "ASH"."SNAP_ID"="SNAP_ID"(+) AND<br/>
"ASH"."INSTANCE_NUMBER"="INSTANCE_NUMBER"(+))</span></span></strong></div>
<div><strong><span style="font-size:14px;"><span style="font-family:Courier New,Courier,monospace;">Note<br/>
-----<br/>
- dynamic statistics used: dynamic sampling (level=2)<br/>
- this is an adaptive plan<br/>
- 1 Sql Plan Directive used for this statement</span></span></strong></div>
<div><br/>
<strong><span style="font-size:14px;"><span style="font-family:Courier New,Courier,monospace;">Statistics<br/>
----------------------------------------------------------<br/>
0 recursive calls<br/>
0 db block gets<br/>
11614 consistent gets<br/>
0 physical reads<br/>
9440 redo size<br/>
44387 bytes sent via SQL*Net to client<br/>
500 bytes received via SQL*Net from client<br/>
2 SQL*Net roundtrips to/from client<br/>
1 sorts (memory)<br/>
0 sorts (disk)<br/>
4812 rows processed</span></span></strong></div> <div> </div> <div>Have a look at the execution plan, only one GROUP BY, definitively one too little.</div> <div> </div> <div>Matthias</div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Dienstag, 07. August 2018 um 18:26 Uhr<br/> <b>Von:</b> "Daniel Fink" <dmarc-***@freelists.org><br/> <b>An:</b> oracle-***@freelists.org<br/> <b>Betreff:</b> Group by wrong results?</div> <div name="quoted-content"> <div>A script to extract session count from ash data is not returning the right results using a TO_CHAR(sample_time, 'YYYYMMDD hh24:mi') group by unless I use a factored subquery. <div> </div> <div>Query 1</div> <div> <div> </div> <div>/</div> </div> <div>Wrong Results example</div> <div> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">SAMPLE_MINUTE<span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>SESS_COUNT</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">-------------- ----------</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:09<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>5</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:09<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>1</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:09<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>1</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:09<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>5</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:09<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>2</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:09<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>4</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:10<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>3</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:10<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>5</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:10<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>1</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:10<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>4</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:10<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>7</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:10<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span>9</span></p> </div> <div>If I add another factored subquery, I get the right aggregation</div> <div> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">WITH session_count AS</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">( SELECT sample_time, count(1) sess_count</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1"><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>FROM dba_hist_active_sess_history</span></p> <p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1"><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>WHERE sample_time >= sysdate - (1/24)</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1"><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>GROUP BY sample_time</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">),</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">session_minutes</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">AS</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">( SELECT TO_CHAR(sample_time, 'YYYYMMDD hh24:mi') sample_minute,</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1"><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>sess_count</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">FROM <span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>session_count</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">)</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">SELECT sample_minute,</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1"><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>MAX(sess_count)</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">FROM session_minutes</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">GROUP BY sample_minute</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">ORDER BY sample_minute</span></p>
</div>
<div>Correct results</div>
<div>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">SAMPLE_MINUTE<span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>MAX(SESS_COUNT)</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">-------------- ---------------</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:01<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>22</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:02<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>22</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:03<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>15</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:04<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>10</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:05<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>11</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:06<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>10</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:07<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>20</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:08<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>20</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:09<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span> <span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>5</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:10<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span> <span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>9</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:11<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>12</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:12<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>12</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:13<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span> <span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>9</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:14<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span> <span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>6</span></p>
<p class="gmail-m_-1570030767890357654gmail-p1" style="margin: 0.0px;font-stretch: normal;font-size: 14.0px;line-height: normal;font-family: "Courier New";color: rgb(244,244,244);"><span class="gmail-m_-1570030767890357654gmail-s1">20180727 09:15<span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span><span class="gmail-m_-1570030767890357654gmail-Apple-tab-span"> </span> <span class="gmail-m_-1570030767890357654gmail-Apple-converted-space"> </span>3</span></p>
</div>
<div>Why is the first query (which looks correct to me) not properly aggregating?</div>
</div>
</div>
</div>
</div>
</div></div></body></html>
--
http://www.freelists.org/webpage/oracle-l