PL/SQL (MOSC)

MOSC Banner

(Multiple) Count distinct not returning counts

edited Apr 12, 2016 10:38AM in PL/SQL (MOSC) 3 commentsAnswered ✓

We have a problem with Oracle Database 12.1.0.2 regarding a query generated by a report system.

The following (simplified) query is executed (for sample table structure and data, see attachment):

SELECT

t2.guid AS data_group_id,

t2.name AS data_group_name,

COUNT(DISTINCT t1.data_internal) AS data_internal,

COUNT(DISTINCT t1.data_view) AS data_view

FROM (

  SELECT

    t.guid AS data_internal,

    t.guid AS data_view,

    t.type

    FROM task t

    WHERE t.guid IN (

      SELECT guid FROM task WHERE assignee IN (HEXTORAW('f4243669d0bd461cb99ec3005d6ec795'), HEXTORAW('c5390aab903f4383b48589579e157b16'))

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center