mysql GROUP BY statement


  Translation results:

UK [ɡru:p bai] US [ɡrup baɪ]

[Calculation][WIN]Group basis

mysql GROUP BY statementsyntax

Function: Used to combine the total function to group the result set according to one or more columns.

Syntax: SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name

mysql GROUP BY statementexample

//查找每个客户的总金额(总订单)。
SELECT Customer,SUM(OrderPrice) FROM Orders GROUP BY Customer;

Popular Recommendations

Home

Videos

Q&A