-- Count of Exams initiated
SELECT DISTINCT
EXM.REGN,
EXM.EXM_COUNT_BY_REGN,
EXM3.DIV,
EXM3.EXM_COUNT_BY_DIV,
EXM2.TOTAL_EXM_COUNT,--,
--EXM4.EXM_TYPE,
--EXM4.EXM_COUNT_BY_EXM_TYPE
-- Count of Exams compleated
EXM5.REGN_COMPL,
EXM5.EXM_COUNT_BY_REGN_COMPL,
EXM7.DIV_COMPL,
EXM6.TOTAL_EXM_COUNT_COMPL ,
EXM7.EXM_COUNT_BY_DIV_COMPL, --,
--EXM8.EXM_TYPE,
--EXM8.EXM_COUNT_BY_EXM_TYPE_COMPL
--Count of Exams compleated with Action
EXM9.REGN_COMPL_W_ACT,
EXM9.EXM_COUNT_BY_REGN_COMPL_W_ACT,
EXM10.DIV_COMPL_W_ACT,
EXM10.EXM_COUNT_BY_DIV_COMPL_W_ACT,
EXM11.TOTAL_EXM_COUNT_COMPL_W_ACT
FROM
LECONS.CMPLN A,
(SELECT ENF_REGN.ENF_REGN_DESC AS REGN,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_REGN
FROM
LECONS.CMPLN,
LECONS.ENF_REGN
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
GROUP BY (ENF_REGN.ENF_REGN_DESC))EXM,
(SELECT
COUNT (*) AS TOTAL_EXM_COUNT
FROM LECONS.CMPLN
WHERE CMPLN_NBR LIKE 'EX%'
)EXM2,
(SELECT
ENF_SECUR_CLS.ENF_SECUR_CLS_DESC AS DIV,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_DIV
FROM LECONS.CMPLN,
LECONS.ENF_REGN,
LECONS.ENF_SECUR_CLS
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
AND CMPLN.ENF_SECUR_CLS_ID = ENF_SECUR_CLS.ENF_SECUR_CLS_ID
GROUP BY (ENF_SECUR_CLS.ENF_SECUR_CLS_DESC))EXM3,--,
--(SELECT CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC AS EXM_TYPE, -- ClientCode not configured yet for FK
--COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_EXM_TYPE
--FROM LECONS.CMPLN, LECONS.ENF_REGN,LECONS.CMPLN_ACTV_TYP
--WHERE CMPLN_NBR LIKE 'EX%'
--AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
--AND CMPLN.CLNT_CMPLN_APLD_TYP_ID = CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_ID
--GROUP BY (CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC))EXM4
-- Count of Exams Compleated
(SELECT
ENF_REGN.ENF_REGN_DESC AS REGN_COMPL,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_REGN_COMPL
FROM LECONS.CMPLN,
LECONS.ENF_REGN,
LECONS.CLNT_CMPLN_STA,
LECONS.CMPLN_STA
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
GROUP BY (ENF_REGN.ENF_REGN_DESC))EXM5,
(SELECT COUNT (*) AS TOTAL_EXM_COUNT_COMPL
FROM LECONS.CMPLN,
LECONS.CLNT_CMPLN_STA,
LECONS.CMPLN_STA
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
)EXM6,
(SELECT
ENF_SECUR_CLS.ENF_SECUR_CLS_DESC AS DIV_COMPL,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_DIV_COMPL
FROM LECONS.CMPLN, LECONS.ENF_REGN,LECONS.ENF_SECUR_CLS,LECONS.CLNT_C MPLN_STA,LECONS.CMPLN_STA
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
AND CMPLN.ENF_SECUR_CLS_ID = ENF_SECUR_CLS.ENF_SECUR_CLS_ID
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
GROUP BY (ENF_SECUR_CLS.ENF_SECUR_CLS_DESC))EXM7,--,
--(SELECT CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC AS EXM_TYPE_COMPL, -- ClientCode not configured yet for FK
--COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_EXM_TYPE
--FROM LECONS.CMPLN, LECONS.ENF_REGN,LECONS.CMPLN_ACTV_TYP
--WHERE CMPLN_NBR LIKE 'EX%'
--AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
--AND CMPLN.CLNT_CMPLN_APLD_TYP_ID = CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_ID
--GROUP BY (CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC))EXM8
-- Count of Exams Compleated with Action taken
(SELECT
ENF_REGN.ENF_REGN_DESC AS REGN_COMPL_W_ACT,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_REGN_COMPL_W_ACT
FROM LECONS.CMPLN,
LECONS.ENF_REGN,
LECONS.CLNT_CMPLN_STA,
LECONS.CMPLN_STA,
LECONS.CMPLN_ACTV
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
AND CMPLN.CMPLN_ID = CMPLN_ACTV.CMPLN_ID
GROUP BY (ENF_REGN.ENF_REGN_DESC))EXM9,
(SELECT COUNT (*) AS TOTAL_EXM_COUNT_COMPL_W_ACT
FROM LECONS.CMPLN,
LECONS.CLNT_CMPLN_STA,
LECONS.CMPLN_STA,
LECONS.CMPLN_ACTV
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
AND CMPLN.CMPLN_ID = CMPLN_ACTV.CMPLN_ID
)EXM11,
(SELECT
ENF_SECUR_CLS.ENF_SECUR_CLS_DESC AS DIV_COMPL_W_ACT,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_DIV_COMPL_W_ACT
FROM LECONS.CMPLN,
LECONS.ENF_REGN,
LECONS.ENF_SECUR_CLS,
LECONS.CLNT_CMPLN_STA,
LECONS.CMPLN_STA,
LECONS.CMPLN_ACTV
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
AND CMPLN.ENF_SECUR_CLS_ID = ENF_SECUR_CLS.ENF_SECUR_CLS_ID
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
AND CMPLN.CMPLN_ID = CMPLN_ACTV.CMPLN_ID
GROUP BY (ENF_SECUR_CLS.ENF_SECUR_CLS_DESC))EXM10--,
--(SELECT CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC AS EXM_TYPE_COMPL, -- ClientCode not configured yet for FK
--COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_EXM_TYPE
--FROM LECONS.CMPLN, LECONS.ENF_REGN,LECONS.CMPLN_ACTV_TYP
--WHERE CMPLN_NBR LIKE 'EX%'
--AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
--AND CMPLN.CLNT_CMPLN_APLD_TYP_ID = CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_ID
--GROUP BY (CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC))EXM8
WHERE 1=1 ;
1 1650
-- Count of Exams initiated
SELECT DISTINCT
EXM.REGN,
EXM.EXM_COUNT_BY_REGN,
EXM3.DIV,
EXM3.EXM_COUNT_BY_DIV,
EXM2.TOTAL_EXM_COUNT,--,
--EXM4.EXM_TYPE,
--EXM4.EXM_COUNT_BY_EXM_TYPE
-- Count of Exams compleated
EXM5.REGN_COMPL,
EXM5.EXM_COUNT_BY_REGN_COMPL,
EXM7.DIV_COMPL,
EXM6.TOTAL_EXM_COUNT_COMPL ,
EXM7.EXM_COUNT_BY_DIV_COMPL, --,
--EXM8.EXM_TYPE,
--EXM8.EXM_COUNT_BY_EXM_TYPE_COMPL
--Count of Exams compleated with Action
EXM9.REGN_COMPL_W_ACT,
EXM9.EXM_COUNT_BY_REGN_COMPL_W_ACT,
EXM10.DIV_COMPL_W_ACT,
EXM10.EXM_COUNT_BY_DIV_COMPL_W_ACT,
EXM11.TOTAL_EXM_COUNT_COMPL_W_ACT
FROM
LECONS.CMPLN A,
(SELECT ENF_REGN.ENF_REGN_DESC AS REGN,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_REGN
FROM
LECONS.CMPLN,
LECONS.ENF_REGN
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
GROUP BY (ENF_REGN.ENF_REGN_DESC))EXM,
(SELECT
COUNT (*) AS TOTAL_EXM_COUNT
FROM LECONS.CMPLN
WHERE CMPLN_NBR LIKE 'EX%'
)EXM2,
(SELECT
ENF_SECUR_CLS.ENF_SECUR_CLS_DESC AS DIV,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_DIV
FROM LECONS.CMPLN,
LECONS.ENF_REGN,
LECONS.ENF_SECUR_CLS
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
AND CMPLN.ENF_SECUR_CLS_ID = ENF_SECUR_CLS.ENF_SECUR_CLS_ID
GROUP BY (ENF_SECUR_CLS.ENF_SECUR_CLS_DESC))EXM3,--,
--(SELECT CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC AS EXM_TYPE, -- ClientCode not configured yet for FK
--COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_EXM_TYPE
--FROM LECONS.CMPLN, LECONS.ENF_REGN,LECONS.CMPLN_ACTV_TYP
--WHERE CMPLN_NBR LIKE 'EX%'
--AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
--AND CMPLN.CLNT_CMPLN_APLD_TYP_ID = CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_ID
--GROUP BY (CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC))EXM4
-- Count of Exams Compleated
(SELECT
ENF_REGN.ENF_REGN_DESC AS REGN_COMPL,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_REGN_COMPL
FROM LECONS.CMPLN,
LECONS.ENF_REGN,
LECONS.CLNT_CMPLN_STA,
LECONS.CMPLN_STA
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
GROUP BY (ENF_REGN.ENF_REGN_DESC))EXM5,
(SELECT COUNT (*) AS TOTAL_EXM_COUNT_COMPL
FROM LECONS.CMPLN,
LECONS.CLNT_CMPLN_STA,
LECONS.CMPLN_STA
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
)EXM6,
(SELECT
ENF_SECUR_CLS.ENF_SECUR_CLS_DESC AS DIV_COMPL,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_DIV_COMPL
FROM LECONS.CMPLN, LECONS.ENF_REGN,LECONS.ENF_SECUR_CLS,LECONS.CLNT_C MPLN_STA,LECONS.CMPLN_STA
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
AND CMPLN.ENF_SECUR_CLS_ID = ENF_SECUR_CLS.ENF_SECUR_CLS_ID
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
GROUP BY (ENF_SECUR_CLS.ENF_SECUR_CLS_DESC))EXM7,--,
--(SELECT CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC AS EXM_TYPE_COMPL, -- ClientCode not configured yet for FK
--COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_EXM_TYPE
--FROM LECONS.CMPLN, LECONS.ENF_REGN,LECONS.CMPLN_ACTV_TYP
--WHERE CMPLN_NBR LIKE 'EX%'
--AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
--AND CMPLN.CLNT_CMPLN_APLD_TYP_ID = CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_ID
--GROUP BY (CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC))EXM8
-- Count of Exams Compleated with Action taken
(SELECT
ENF_REGN.ENF_REGN_DESC AS REGN_COMPL_W_ACT,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_REGN_COMPL_W_ACT
FROM LECONS.CMPLN,
LECONS.ENF_REGN,
LECONS.CLNT_CMPLN_STA,
LECONS.CMPLN_STA,
LECONS.CMPLN_ACTV
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
AND CMPLN.CMPLN_ID = CMPLN_ACTV.CMPLN_ID
GROUP BY (ENF_REGN.ENF_REGN_DESC))EXM9,
(SELECT COUNT (*) AS TOTAL_EXM_COUNT_COMPL_W_ACT
FROM LECONS.CMPLN,
LECONS.CLNT_CMPLN_STA,
LECONS.CMPLN_STA,
LECONS.CMPLN_ACTV
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
AND CMPLN.CMPLN_ID = CMPLN_ACTV.CMPLN_ID
)EXM11,
(SELECT
ENF_SECUR_CLS.ENF_SECUR_CLS_DESC AS DIV_COMPL_W_ACT,
COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_DIV_COMPL_W_ACT
FROM LECONS.CMPLN,
LECONS.ENF_REGN,
LECONS.ENF_SECUR_CLS,
LECONS.CLNT_CMPLN_STA,
LECONS.CMPLN_STA,
LECONS.CMPLN_ACTV
WHERE CMPLN_NBR LIKE 'EX%'
AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
AND CMPLN.ENF_SECUR_CLS_ID = ENF_SECUR_CLS.ENF_SECUR_CLS_ID
AND CMPLN.CLNT_CMPLN_STA_ID = CLNT_CMPLN_STA.CLNT_CMPLN_STA_ID
AND CLNT_CMPLN_STA.CMPLN_STA_ID = CMPLN_STA.CMPLN_STA_ID
AND CMPLN.CMPLN_ID = CMPLN_ACTV.CMPLN_ID
GROUP BY (ENF_SECUR_CLS.ENF_SECUR_CLS_DESC))EXM10--,
--(SELECT CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC AS EXM_TYPE_COMPL, -- ClientCode not configured yet for FK
--COUNT (CMPLN.ENF_REGN_ID) AS EXM_COUNT_BY_EXM_TYPE
--FROM LECONS.CMPLN, LECONS.ENF_REGN,LECONS.CMPLN_ACTV_TYP
--WHERE CMPLN_NBR LIKE 'EX%'
--AND CMPLN.ENF_REGN_ID = ENF_REGN.ENF_REGN_ID
--AND CMPLN.CLNT_CMPLN_APLD_TYP_ID = CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_ID
--GROUP BY (CMPLN_ACTV_TYP.CMPLN_ACTV_TYP_DESC))EXM8
WHERE 1=1 ;
Are you getting the output finally after runing for long time?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Trevor Fairchild |
last post by:
I've got a program that parses text files. The text files come to me
in Unicode and they contain goofy characters that VB chokes on -
treats them as eof markers. I have already been through this...
|
by: Maria |
last post by:
Hello
I have not used db2 in a long time, and I have this very long insert
script, which is giving me an error of duplicated inserts.
My question is how can I put something in the statment so...
|
by: 73blazer |
last post by:
Hello,
I'm looking for a SQL syntax to put a variable name into the from clause.
Specifically I have a colume in a table that is table name, and I want
to use that result in the from clause in a...
|
by: 73blazer |
last post by:
Hello,
I'm looking for a way to make some of my insert templates more readable
by placing comments in between the values. I cannot seem to find a way
to do this with DB2, is there a way? I'm...
|
by: sapnsapn |
last post by:
There is a statement in c code I am reviewing
filenum = atoll(item->d_name + strlen(msgid_with_append_str) + 1);
In a certain snapshot,
item->d_name = 050707143827.AAAA.11810.00000001...
|
by: Me, Myself, and I |
last post by:
First off, i apologize if my terminology is off...
I am currently in a project that is basically a front-end to a
database. In coding this, I am taking into account that it has the
*potential*...
|
by: Scot |
last post by:
I have the following code:
Dim IP, domainName As String
domainName = "yahoo.com"
Try
IP = System.Net.Dns.GetHostByName(domainName).AddressList(0).ToString()
Catch ex As Exception
IP = "Not...
|
by: fniles |
last post by:
I am having problem with thread. I have a Session class with public string
variable (called Message) that I set from my Main program. In the session
class it checks for the value of Message...
|
by: zeebiggie |
last post by:
Good morning
I have a form with the controls in the insert statment below. table1 has an Auto increment primary key hence is omitted in the insert statment and form. Am getting the error It didnt...
|
by: Leigh |
last post by:
This is the query I have to update a column in one table, by comparing 2 of its columns to with the columns of another table. The WIE_Physician table has 1655 records, hence the loop, and the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |