January 08, 2016, 02:20 AM
Davecount distinct with D
I have this simple query.
TABLE FILE CAR
SUM CNT.DST.CAR
END
Returns 10
TABLE FILE CAR
SUM CNT.DST.CAR/D6
END
Returns 1
SQL produced: ( when running on a real database, not CAR )
SELECT
COUNT(DISTINCT COUNT(DISTINCT T2."WTF_ID"))(INTEGER),
SUM(T2."WTF_ID")(INTEGER)
FROM
INGRESS.P06;
With these warnings ( no errors, it just continues )
FOC2589 - AGGREGATION DONE BUT MAY PRODUCE INCONSISTENT RESULTS
FOC2612 - OVERFLOW MAY OCCUR WHEN SUMMING AN I2 FIELD WITH USAGE I, D OR P
A count distinct over a count distinct? Seems like something got lost in translation.
Is this adapter specific?
Greets,
Dave
January 08, 2016, 03:50 AM
Wep5622A distinct count of distinct counts? Peculiar!
That looks a lot like the a bug I reported in 8.1.03 where the generated query contains a syntax error because it contains 2 distinct clauses.
Unfortunately, tech support seems to be offline at the moment, or I would have had more details.
January 08, 2016, 04:48 AM
Danny-SRLI tried.
In both cases I get 10.
However with the format the TITLE is CAR,COUNT; without the format it is COUNT,DISTINCT,CAR.
Go figure!
January 08, 2016, 11:17 AM
jgelonaI've never seen that with Oracle.
January 12, 2016, 10:22 AM
BabakNYCI just tested SUM CNT.DST.CAR/D6 in WF 8105 using both Oracle and SQL Server and got the following correct translation:
AGGREGATION DONE ...
SELECT
COUNT(DISTINCT T1."CARS")
FROM
HR.CAR_ORA T1;
AGGREGATION DONE ...
SELECT
COUNT(DISTINCT T1."CARS")
FROM
CAR_MSS T1;
Unfortunately, I don't have access Ingress to test.