Discussion

3
Replies
683
Views
josenavas Member since 2013 23 posts
Hoverstate
Posted: 5 years ago
Last activity: 5 years ago
Closed

Replicate SQL with sub-queries inside PRPC

Hi,

I'm trying to replicate this SQL in PRPC:

SELECT T1.pxassignedoperatorid,
  T1.TOTAL,
  T2.SLADEADLINE
FROM
  (SELECT pxassignedoperatorid,
    COUNT (*) AS TOTAL
  FROM pc_assign_workbasket
  GROUP BY pxassignedoperatorid
  ) T1
LEFT OUTER JOIN
  (SELECT pxassignedoperatorid,
    COUNT (*) AS SLADEADLINE
  FROM pc_assign_workbasket
  WHERE pxdeadlinetime IS NOT NULL
  GROUP BY pxassignedoperatorid
  ) T2
ON T1.pxassignedoperatorid = T2.pxassignedoperatorid
ORDER BY T1.pxassignedoperatorid

 

To get a table like this:

PXASSIGNEDOPERATORID | TOTAL | SLADEADLINE

WorkBasket1 | 18 | 3

WorkBasket2 | 688 | (null)

WorkBasket3 | 1029 | 66

 

The above works in Oracle's SQL Developer. But I can't seem to find a solution in PRPC using Report Definitions... I tried using two Sub-Reports (one for each query in the parenthesis) inside a Report Definition, but I can't configure the "left outer join".

Any help is appreciated.

Thanks,

Jose

Reporting
Moderation Team has archived post
Share this page LinkedIn