The SELECT COUNTY_ID,
The SUM (decode (CONCAT (FEE_YEAR LPAD (FEE_MONTH, 2 '0')), '201603', MONEY, 0)),
The SUM (decode (CONCAT (FEE_YEAR LPAD (FEE_MONTH, 2 '0')), '201604', MONEY, 0)),
The SUM (decode (CONCAT (FEE_YEAR LPAD (FEE_MONTH, 2 '0')), '201605', MONEY, 0)),
The SUM (decode (CONCAT (FEE_YEAR LPAD (FEE_MONTH, 2 '0')), '201703', MONEY, 0)),
The SUM (decode (CONCAT (FEE_YEAR LPAD (FEE_MONTH, 2 '0')), '201704', MONEY, 0)),
The SUM (decode (CONCAT (FEE_YEAR LPAD (FEE_MONTH, 2 '0')), '201705', MONEY, 0)),
The FROM
(the SELECT FE. COUNTY_ID, FE FEE_YEAR, FE. FEE_MONTH, SUM (FE) MONTHLY_MONEY) MONEY FROM FE_MT_FEE_FILL FE GROUP BY FE. COUNTY_ID, FE. FEE_YEAR, FE. FEE_MONTH)
GROUP BY COUNTY_ID
This is my SQL, in which the SUM (decode (CONCAT (FEE_YEAR, LPAD (FEE_MONTH, 2 '0')), '201705', MONEY, 0)) by joining together the SQL, are used to implement multiple lines turn a line, the number is variable, and may be any number, I want to ask, in SUM, decode (CONCAT (FEE_YEAR, LPAD (FEE_MONTH, 2 '0')), '201705', MONEY, 0)) number and more database under the condition of special data will there be special significantly lower efficiency
CodePudding user response:
Affect the efficiency of the general is not a functionCodePudding user response:
General main consumption efficiency in IO on the physical disk read and logic,The influence of functional operation efficiency scores of small,