JasonMcConnell
Technical User
Hi,
I’ve got the following scrip (SQL Plus) that works like a charm but I have noticed that is duplication some records.
SET ECHO OFF
set pagesize 0
set feedback off
set heading on
set validate off
set termout off
set trimspool on
set markup HTML on
spool c:\ApplicationInfo.HTML
SELECT
BCAPPLICATION."APPLICATION_NUMBER", BCAPPLICATION."SITE_ADDRESS", BCAPPLICATION."DEVELOPMENT_DESCRIPTION", BCAPPLICATION."VALIDATED_DATE", BCAPPLICATION."COMMENCEMENT_DATE", BCAPPLICATION."COMPLETION_DATE", BCAPPLICATION."DECISION_DATE",
BCDECISION."DECISION_TYPE_CODE",
LOVS."STD_DATA_CODE", LOVS."LOV_DESC",
OFFICER."FULL_NAME"
FROM
"LAND"."BCAPPLICATION" BCAPPLICATION,
"LAND"."BCRESPONSIBLE_OFFICER" BCRESPONSIBLE_OFFICER,
"LAND"."BCDECISION" BCDECISION,
"LAND"."LOVS" LOVS,
"LAND"."OFFICER" OFFICER
WHERE
BCAPPLICATION."REFERENCE" = BCRESPONSIBLE_OFFICER."BCA_REFERENCE" (+) AND
BCAPPLICATION."REFERENCE" = BCDECISION."BCA_REFERENCE" (+) AND
BCDECISION."DECISION_TYPE_CODE" = LOVS."LOV_CODE" (+) AND
BCRESPONSIBLE_OFFICER."OFFICER_CODE" = OFFICER."CODE" (+)
ORDER BY
BCAPPLICATION."APPLICATION_NUMBER" ASC,
LOVS."STD_DATA_CODE" ASC;
spool off
set markup HTML off
Basically I need to know how to amend this so it groups by bcapplication_number?
Can anybody help?
e.g.FP/2007/00012/A - should only appear once
FP/2007/00010
FP/2007/00012/A
FP/2007/00012/A
FP/2007/00012/A
FP/2007/00015
FP/2007/00016
FP/2007/00017
FP/2007/00022
FP/2007/00023
FP/2007/00024
FP2007/0001/0
FP2007/0003/0
IN/2007/00014
IN/2007/00026
IN/2007/00036
IN/2007/00036
LTC/2007/00011
LTC/2007/00025
I’ve got the following scrip (SQL Plus) that works like a charm but I have noticed that is duplication some records.
SET ECHO OFF
set pagesize 0
set feedback off
set heading on
set validate off
set termout off
set trimspool on
set markup HTML on
spool c:\ApplicationInfo.HTML
SELECT
BCAPPLICATION."APPLICATION_NUMBER", BCAPPLICATION."SITE_ADDRESS", BCAPPLICATION."DEVELOPMENT_DESCRIPTION", BCAPPLICATION."VALIDATED_DATE", BCAPPLICATION."COMMENCEMENT_DATE", BCAPPLICATION."COMPLETION_DATE", BCAPPLICATION."DECISION_DATE",
BCDECISION."DECISION_TYPE_CODE",
LOVS."STD_DATA_CODE", LOVS."LOV_DESC",
OFFICER."FULL_NAME"
FROM
"LAND"."BCAPPLICATION" BCAPPLICATION,
"LAND"."BCRESPONSIBLE_OFFICER" BCRESPONSIBLE_OFFICER,
"LAND"."BCDECISION" BCDECISION,
"LAND"."LOVS" LOVS,
"LAND"."OFFICER" OFFICER
WHERE
BCAPPLICATION."REFERENCE" = BCRESPONSIBLE_OFFICER."BCA_REFERENCE" (+) AND
BCAPPLICATION."REFERENCE" = BCDECISION."BCA_REFERENCE" (+) AND
BCDECISION."DECISION_TYPE_CODE" = LOVS."LOV_CODE" (+) AND
BCRESPONSIBLE_OFFICER."OFFICER_CODE" = OFFICER."CODE" (+)
ORDER BY
BCAPPLICATION."APPLICATION_NUMBER" ASC,
LOVS."STD_DATA_CODE" ASC;
spool off
set markup HTML off
Basically I need to know how to amend this so it groups by bcapplication_number?
Can anybody help?
e.g.FP/2007/00012/A - should only appear once
FP/2007/00010
FP/2007/00012/A
FP/2007/00012/A
FP/2007/00012/A
FP/2007/00015
FP/2007/00016
FP/2007/00017
FP/2007/00022
FP/2007/00023
FP/2007/00024
FP2007/0001/0
FP2007/0003/0
IN/2007/00014
IN/2007/00026
IN/2007/00036
IN/2007/00036
LTC/2007/00011
LTC/2007/00025