I have a table shown in picture. I want to enter the distinct agent_name and their total time values in another table. I tried this code for the sum of time
SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(TIME))) AS total FROM table name WHERE agent_name="name";
In another table, I want to show only agent name and their total time.
根据您的要求“选择不同的agent_name并显示总时间值”
SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(TIME))), agent_name AS total FROM table name group by agent_name;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.