Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Report SQL

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

-- Sub-query mode

Select r. Organnorec. R. Organname. sum (r.vrc), sum (r.psatf), sum (r.vtf), (select a.rate from tb_accrate a where a.organno=r.organno and a. Classttypedia. 03') from TBC_QRCODEPOISE_REP r group by r. Organno. R. Organname

-- Associated query method

SELECT T. SUM, A.RATE FROM (SELECT R.ORGANNO, R.ORGANNAME, SUM (R.VRC), SUM (R.PSATF), SUM (R.VTF))

FROM TBC_QRCODEPOISE_REP R GROUP BY R.ORGANNO, R.ORGANNAME) T

LEFT JOIN TB_ACCRATE A

ON T.ORGANNO = A.ORGANNO

AND A.ACCOUNTTYPE = '03'

WHERE T.ORGANNO IN (SELECT A.ORGANNO FROM TB_ACCRATE A WHERE A.ACCOUNTTYPE = '03')

-- displayed according to the quantity of the rate table

SELECT A.ORGANNOCHO.ORGANNAME FROM TB_ACCRATE A (T.VRC), nvl (T.PSATF), ORGANNAME (T.VTF), ORGANNAME A

LEFT JOIN TB_ORGAN O ON A.ORGANNO=O.ORGANNO

LEFT JOIN (SELECT R.ORGANNO, R.ORGANNAME, SUM (R.VRC) VRC, SUM (R.PSATF) PSATF, SUM (R.VTF) VTF

FROM TBC_QRCODEPOISE_REP R where R.WORKDATE > = TO_DATE ('2018-02-25mm AND R.WORKDATE) AND R.WORKDATE

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report