Home > database >  Write a SQL to filter out the sum of the sum of multiple data 0 multiple data
Write a SQL to filter out the sum of the sum of multiple data 0 multiple data

Time:09-17

Write a SQL to filter out the sum of the sum of multiple data 0 multiple data

CodePudding user response:

Group by the back to add a having filtering

CodePudding user response:

having

CodePudding user response:

Polymerization of filter, please refer to the aggregate function of filtration method

CodePudding user response:

Parameter description:
Group field, is the mark to distinguish between individual data, can be one of the data of id, specific to the actual situation shall prevail;
A, b, c is the title of multiple fields;
Implementation of SQL is as follows:
A SELECT group field, sum (a + b + c)
FROM the table name
GROUP BY GROUP field
HAVING the sum (a + b + c)=0.
  • Related