0
我有2個查詢,如下所示的joing結果,2個查詢與上相同的表不同groupByclauses
這些查詢的query1 = select department as 'Department_name', firstname as 'FirstName', lastname as 'LastName', manager as 'Manager',
title as 'Title', firstofficer as 'First_Officer', email as 'Email', resourceName as 'Resource Name',
entitlementName as 'Ent Name', concat(resourcename, entitlementname) AS 'Entitlements', count(distinct uid)
as 'Total_Common' from outlier_report or1
group by department, concat(resourcename, entitlementname)
query2 = select department as 'Department_name',
count(distinct uid) AS 'Total count of user',
count(distinct resourcename) AS 'Total resource count',
count(distinct concat(resourcename,entitlementname)) as 'Total Ent Count'
from outlier_report or2 group by department;
每個返回(基於組由子句115和125分別地)的結果的不同計數 我必須加入這兩個結果,以便我擁有所有的領域和4個計數(1個來自第一個,另外3個來自其他)。 如何使用SQL連接或使用Java程序來將單獨的查詢結果操作爲1輸出csv。