Data extracted from the two tables inline, where the Category_name field has the same content, want to merge fields with the same content, add the Amount field, and change the contents of the following table
SELECTC.Category_name,Count(*) as Task_num,sum(T.Amount) asAmount_num
fromCs_witkey_tasks asT
INNERJOINcs_witkey_category asC onT.category_id= C.CID
GROUP byC.Category_nameDESC
You should use GROUP by instead of order by.
Data that is fetched inline from two tables. The Category_name field has the same content. To merge fields with the same content, add the Amount field. into the following table
SELECTC.Category_name,Count(*) as Task_num,sum(T.Amount) asAmount_num
fromCs_witkey_tasks asT
INNERJOINcs_witkey_category asC onT.category_id= C.CID
GROUP byC.Category_nameDESC
You should use GROUP by instead of order by.
MySQL the same content field is merged into one method