客户要求取出某指定的FSG报表的明细行定义的数据,以下是相关的SQL命令:
SELECT *
FROM (SELECT RRA.NAME,
RRV.SEQUENCE,
RRV.DESCRIPTION,
RRV.NUMBER_CHARACTERS_INDENTED,
RRV.NUMBER_LINES_SKIPPED_BEFORE,
RRV.NUMBER_LINES_SKIPPED_AFTER,
RRV.AMOUNT_TYPE,
RRV.UNIT_OF_MEASURE_ID,
RRV.PARAMETER_NUM,
RRV.PERIOD_OFFSET,
RRV.FACTOR,
RRV.LEVEL_OF_DETAIL,
RRV.DISPLAY_FLAG,
RRV.DISPLAY_ZERO_AMOUNT_FLAG,
RRV.CHANGE_SIGN_FLAG,
RRV.CHANGE_VARIANCE_SIGN_FLAG,
RRV.CALCULATION_PRECEDENCE_FLAG,
RRC.SIGN,
RRC.LEDGER_ID,
RRC.SEGMENT1_LOW || '.' || RRC.SEGMENT2_LOW || '.' ||
RRC.SEGMENT3_LOW || '.' || RRC.SEGMENT4_LOW || '.' ||
RRC.SEGMENT5_LOW || '.' || RRC.SEGMENT6_LOW || '.' ||
RRC.SEGMENT7_LOW || '.' || RRC.SEGMENT8_LOW SEGMENT_LOW,
RRC.SEGMENT1_HIGH || '.' || RRC.SEGMENT2_HIGH || '.' ||
RRC.SEGMENT3_HIGH || '.' || RRC.SEGMENT4_HIGH || '.' ||
RRC.SEGMENT5_HIGH || '.' || RRC.SEGMENT6_HIGH || '.' ||
RRC.SEGMENT7_HIGH || '.' || RRC.SEGMENT8_HIGH SEGMENT_HIGH,
RRC.SEGMENT1_TYPE || '.' || RRC.SEGMENT2_TYPE || '.' ||
RRC.SEGMENT3_TYPE || '.' || RRC.SEGMENT4_TYPE || '.' ||
RRC.SEGMENT5_TYPE || '.' || RRC.SEGMENT6_TYPE || '.' ||
RRC.SEGMENT7_TYPE || '.' || RRC.SEGMENT8_TYPE SEGMENT_HIGH_TYPE,
RRC.RANGE_MODE,
RRC.DR_CR_NET_CODE,
NULL CALCULATION_SEQ,
NULL OPERATOR,
NULL CONSTANT,
NULL AXIS_SEQ_LOW,
NULL AXIS_SEQ_HIGH,
NULL AXIS_NAME_LOW
FROM RG_REPORT_AXIS_SETS_V RRA,
RG_REPORT_AXES_V RRV,
RG_REPORT_AXIS_CONTENTS RRC
WHERE 1 = 1
AND RRC.AXIS_SET_ID = RRA.AXIS_SET_ID
AND RRC.AXIS_SEQ = RRV.SEQUENCE
AND RRA.AXIS_SET_ID = RRV.AXIS_SET_ID
AND RRA.NAME IN ('XXXX_新准则CIRC统计指标')
UNION ALL
SELECT RRA.NAME,
RRV.SEQUENCE,
RRV.DESCRIPTION,
RRV.NUMBER_CHARACTERS_INDENTED,
RRV.NUMBER_LINES_SKIPPED_BEFORE,
RRV.NUMBER_LINES_SKIPPED_AFTER,
RRV.AMOUNT_TYPE,
RRV.UNIT_OF_MEASURE_ID,
RRV.PARAMETER_NUM,
RRV.PERIOD_OFFSET,
RRV.FACTOR,
RRV.LEVEL_OF_DETAIL,
RRV.DISPLAY_FLAG,
RRV.DISPLAY_ZERO_AMOUNT_FLAG,
RRV.CHANGE_SIGN_FLAG,
RRV.CHANGE_VARIANCE_SIGN_FLAG,
RRV.CALCULATION_PRECEDENCE_FLAG,
NULL SIGN,
NULL LEDGER_ID,
NULL SEGMENT_LOW,
NULL SEGMENT_HIGH,
NULL SEGMENT_HIGH_TYPE,
NULL RANGE_MODE,
NULL DR_CR_NET_CODE,
RRC1.CALCULATION_SEQ,
RRC1.OPERATOR,
RRC1.CONSTANT,
RRC1.AXIS_SEQ_LOW,
RRC1.AXIS_SEQ_HIGH,
RRC1.AXIS_NAME_LOW
FROM RG_REPORT_AXIS_SETS_V RRA,
RG_REPORT_AXES_V RRV,
RG_REPORT_CALCULATIONS RRC1
WHERE 1 = 1
AND RRC1.AXIS_SET_ID = RRA.AXIS_SET_ID
AND RRC1.AXIS_SEQ = RRV.SEQUENCE
AND RRA.AXIS_SET_ID = RRV.AXIS_SET_ID
AND RRA.NAME IN ('XXXX_新准则CIRC统计指标')
UNION ALL
SELECT RRA.NAME,
RRV.SEQUENCE,
RRV.DESCRIPTION,
RRV.NUMBER_CHARACTERS_INDENTED,
RRV.NUMBER_LINES_SKIPPED_BEFORE,
RRV.NUMBER_LINES_SKIPPED_AFTER,
RRV.AMOUNT_TYPE,
RRV.UNIT_OF_MEASURE_ID,
RRV.PARAMETER_NUM,
RRV.PERIOD_OFFSET,
RRV.FACTOR,
RRV.LEVEL_OF_DETAIL,
RRV.DISPLAY_FLAG,
RRV.DISPLAY_ZERO_AMOUNT_FLAG,
RRV.CHANGE_SIGN_FLAG,
RRV.CHANGE_VARIANCE_SIGN_FLAG,
RRV.CALCULATION_PRECEDENCE_FLAG,
NULL SIGN,
NULL LEDGER_ID,
NULL SEGMENT_LOW,
NULL SEGMENT_HIGH,
NULL SEGMENT_HIGH_TYPE,
NULL RANGE_MODE,
NULL DR_CR_NET_CODE,
NULL CALCULATION_SEQ,
NULL OPERATOR,
NULL CONSTANT,
NULL AXIS_SEQ_LOW,
NULL AXIS_SEQ_HIGH,
NULL AXIS_NAME_LOW
FROM RG_REPORT_AXIS_SETS_V RRA, RG_REPORT_AXES_V RRV
WHERE 1 = 1
AND RRA.AXIS_SET_ID = RRV.AXIS_SET_ID
AND RRA.NAME IN ('XXXX_新准则CIRC统计指标')
AND NOT EXISTS (SELECT 1
FROM RG_REPORT_AXIS_CONTENTS T
WHERE T.AXIS_SET_ID = RRA.AXIS_SET_ID
AND T.AXIS_SEQ = RRV.SEQUENCE)
AND NOT EXISTS (SELECT 1
FROM RG_REPORT_CALCULATIONS T2
WHERE T2.AXIS_SET_ID = RRA.AXIS_SET_ID
AND T2.AXIS_SEQ = RRV.SEQUENCE)
)
WHERE 1 = 1
ORDER BY NAME, SEQUENCE;