Home > database >  The same table with multiple display for help
The same table with multiple display for help

Time:09-22

Below is the statement I wrote, but it is too long, there are a lot of repetition, feel don't have to write so many times, can someone please optimization, or is there any way to optimize, thank you


Select a3. Code a3. Name, p_code_ does not display, is_end,
A3. The item number, a3. The project name, a3. The implementation of the main body, a3. Project categories, a3. Declare amount
, a3. Approval amount, a3), by the competent department of a3. Project classification, a3. The contract amount, a3. Review the amount of settlement a3. The construction unit, the a3. People,
A3. Benefit number, a3. The implementation of administrative villages, a3. Implementation of location, a3. The program start date, a3. The plan completion date,
A3. The project, the notification form attachments a3. Village, a3. The actual commencement date, a3. The actual completion date, a3. The evaluation opinions,
A3. Assessment attachments, a3. Assess the remark,
A3. The appropriate amount of 1, a3. Original documents no. 1, a3. 1 payment time, a3. Payment total accounted for more than 1,
A3. The appendix 1, a3. Invoice attachment 1, a3. Acceptance report attachment 1, a3. Settlement review attachment 1,
A3. The announcement of the public, annex 1 a3. The letter of acceptance or triple a big minutes attachment 1, a3, and poor benefit coupling mechanism, annex 1
A3. Other accessories set 1,
A3. The allocated amount 2 a3. Original documents no. 2, a3. 2, the payment time a3. Payment total accounted for more than 2,
A3. Appendix 2 a3. Invoice in annex 2, a3. Acceptance report, attachment 2 a3. The settlement audit in annex 2,
A3. The announcement of the public, attachment 2 a3. The letter of acceptance or triple a big minutes in annex 2, a3, and poor benefit coupling mechanism in annex 2,
A3. Other accessories set 2,
A3. The appropriate amount of 3, a3. Original documents no. 3, a3. Payment time is 3, a3. Payment total accounted for more than 3,
A3. Appendix 3, a3. 3 invoice attachment, a3. Acceptance report attachment 3, a3. 3 settlement review attachment,
A3. The announcement of the public in attachment 3, a3. The letter of acceptance or triple a 3 minutes attachment, a3, and poor benefit coupling mechanism in attachment 3,
A3. Other accessories set 3,
B4. Dab_bcbfje_b the allocated amount 4, b4 dab_ysdjbh_b original documents number 4, b4. 4 dab_fksj_b payment time, b4. Dab_fkzzb_c payment total accounted for more than 4,
B4. Dab_htfj_b contract annex 4, b4. 4 dab_fpfj_c invoice attachment, b4. 4 dab_ysbgfj_b acceptance report attachment, b4. 4 dab_jspsfj_c settlement review attachment,
B4. Dab_gggsfj_b announcement published in attachment 4, b4 dab_zbtzshszydjyfj_c the bid-winning notice or triple a 4 minutes attachment, b4. Dab_ypkhlyljjzfj_b and poor benefit coupling mechanism in attachment 4,
B4. Dab_qtfjj_c other accessories set 4
The from
(select a2. Code, a2. Name, p_code_ does not display, is_end,
A2. Item number, a2. The project name, a2. The implementation of the main body, a2. Project categories, a2. Declare amount
, a2. Approval amount, a2. The competent department, a2. Project classification, a2. The contract amount, a2. The amount of settlement audit, a2. The construction unit, a2. People,
A2. Benefit number, a2. The implementation of administrative villages, a2. Implementation of location, a2. The program start date, a2. The plan completion date,
A2. The project, the notification form attachments a2. Village, a2. The actual commencement date, a2. The actual completion date, a2. The evaluation opinions,
A2. Assessment attachments, a2. Assess the remark,
A2. The appropriate amount of 1, a2. Original documents no. 1, a2. 1 payment time, a2. Payment total accounted for more than 1,
A2. The appendix 1, a2. Invoice attachment 1, a2. Acceptance report attachment 1, a2. Settlement review attachment 1,
A2. The announcement of the public, annex 1 a2. The letter of acceptance or triple a big minutes attachment 1, a2, and poor benefit coupling mechanism, annex 1
A2. Other accessories set 1,
A2. The allocated amount 2 a2. Original documents no. 2, a2. 2 payment time, a2. Payment total accounted for more than 2,
A2. Appendix 2, a2. Invoice in annex 2, a2. Acceptance report, attachment 2 a2. Settlement review in annex 2,
A2. The announcement of the public in annex 2, a2. The bid-winning notice or triple a big minutes in annex 2, a2, and poor benefit coupling mechanism in annex 2,
A2. Other accessories set 2,
B3. Dab_bcbfje_b the allocated amount 3, b3. Dab_ysdjbh_b original documents no. 3, b3. 3 dab_fksj_b payment time, b3. Dab_fkzzb_c payment total accounted for more than 3,
B3. Dab_htfj_b contract appendix 3, b3. 3 dab_fpfj_c invoice attachment, b3. 3 dab_ysbgfj_b acceptance report attachment, b3. 3 dab_jspsfj_c settlement review attachment,
B3. Dab_gggsfj_b announcement public attachment 3, b3. Dab_zbtzshszydjyfj_c the bid-winning notice or triple a 3 minutes attachment, b3. Dab_ypkhlyljjzfj_b and poor benefit coupling mechanism in attachment 3,
B3. Dab_qtfjj_c other accessories set 3
The from
(select a1. Code, a1. Name, p_code_ does not display, is_end,
A1. Item number, a1. The project name, a1. The implementation of the main body, a1. Project categories, a1. Declare amount
, a1. Approval amount, a1. The competent department, a1. Project classification, a1. The contract amount, a1. Review the amount of settlement a1. The construction unit, a1. People,
A1. Benefit number, a1. Implementation of the administrative villages, a1. Implementation of location, a1. The program start date, a1. Plan completion date,
A1. The project, the notification form attachments a1. Don't of the village, a1. The actual commencement date, a1. The actual completion date, a1. Assessment,
A1. Assessment attachments, a1. Assess the remark,
A1. The appropriate amount of 1, a1. Original documents no. 1, a1. 1 payment time, a1. Payment total accounted for more than 1,
A1. The appendix 1, a1. Invoice attachment 1, a1. Acceptance report attachment 1, a1. Settlement review attachment 1,
A1. The announcement of the public, annex 1 a1. The letter of acceptance or triple a big minutes attachment 1, a1) with poor benefit coupling mechanism, annex 1
A1. Other accessories set 1,
B2. Dab_bcbfje_b the allocated amount 2, b2 dab_ysdjbh_b original document no. 2, b2. 2 dab_fksj_b payment time, b2. Dab_fkzzb_c payment total accounted for more than 2,
B2. Dab_htfj_b contract annex 2, b2 dab_fpfj_c invoice in annex 2, b2. Dab_ysbgfj_b acceptance report, attachment 2 b2. Dab_jspsfj_c settlement review in annex 2,
B2. Dab_gggsfj_b announcement of the public in annex 2, b2 dab_zbtzshszydjyfj_c the bid-winning notice or triple a big minutes in annex 2, b2. Dab_ypkhlyljjzfj_b and poor benefit coupling mechanism in annex 2,
B2. Dab_qtfjj_c other accessories set 2
The from
(select A.x msbb1_xmbh code, A.x MMC name, null p_code_ don't show, '1' as is_end,
A.x msbb1_xmbh item number, A.x MMC project name, A.x msbb1_sszt implementation main body, A.x MLBZB project category, A.x msbb1_xsbje declare amount
, A.X MSBB1_PFJE approval amount, A.Z GBMZB departments, A.X MFLZB project classification, A.X msbb1_htje contract amount, A.X review msbb1_jspsje settlement amount, A.X MSBB1_SGDW construction units, A.X MSBB1_SYRK people,
A.X MSBB1_SYHS benefit number, A.S SXZCZB implement administrative villages, A.X msbb1_ssxzcdd implement site, A.X MSBB1_SGDW_F project commencement date, A.X MSBB1_JHWGRQ plan completion date,
A.X msbb1_Xmsbbfj project, the notification form attachments A.X ZCCBZB village, A.X msbb1_sjkgrq actual start date, A.X msbb1_sjwgrq actual completion date, A.X MSBB1_PGYJ assessment,
A.x msbb1_pgbgfj assessment attachments, a.x msbb1_bz assessment note,
B1. Dab_bcbfje_b the allocated amount of 1, b1 dab_ysdjbh_b original documents no. 1, b1. 1 dab_fksj_b payment time, b1. Dab_fkzzb_c payment total accounted for more than 1,
B1. Dab_htfj_b contract annex 1, b1 dab_fpfj_c invoice attachment 1, b1. Attachment 1 dab_ysbgfj_b acceptance report, b1. Dab_jspsfj_c settlement review attachment 1,
B1. Dab_gggsfj_b announcement published in attachment 1, b1 dab_zbtzshszydjyfj_c the bid-winning notice or triple a big minutes attachment 1, b1. Dab_ypkhlyljjzfj_b and poor benefit coupling mechanism, annex 1
B1. Dab_qtfjj_c other accessories set 1
The from
(select * from (select * from ur_da_xmsbb1_01 a JOIN UR_SYS_DW b
On a. d. w=b.d w_id
WHERE S_DATA_ID IN (select PROJ_ID from UR_TASK_LOG WHERE AFT_ADT_NODE='X')) a left join
(select count (dab_xmbh_c) as number of upload, dab_xmbh_c from ur_da_dab_01 group by dab_xmbh_c) b
On a.x msbb1_xmbh=b.d ab_xmbh_c) a
Left the join
(select * from UR_DA_DAB_01 WHERE SCCS=1) B1
ON A.X MSBB1_XMBH=B1. DAB_XMBH_C
A1) left the join
(select * from UR_DA_DAB_01 WHERE SCCS=2) B2
ON A1. Item number=B2. DAB_XMBH_C) a2 left join
(select * from UR_DA_DAB_01 WHERE SCCS=3) B3
ON A2. Item number=B3. DAB_XMBH_C) a3 left join
(select * from UR_DA_DAB_01 WHERE SCCS=4) B4
ON A3. Item number=B4. DAB_XMBH_C

CodePudding user response:

Such a long code oh,,,

CodePudding user response:

Don't be so grading join, join all the table at a time, and then only remove a good
Never write so complicated code, one thousand cases have change, since change when it's crazy
  • Related