[英]Insert record into another table
I have a table shown in picture. 我有一张图片所示的桌子。 I want to enter the distinct agent_name and their total time values in another table. 我想在另一个表中输入不同的agent_name及其总时间值。 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;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.