Grup all并终止总计

时间:2013-06-02 18:16:46

标签: php mysql select

我有下一个查询:

SELECT COUNT(*) as 8day 
FROM ( 
    SELECT data_raport, SUM(ore) as Total_Hours 
    FROM sohy_works 
    WHERE data_raport BETWEEN '" . $_GET['data']."' AND '" . $_GET['data-2'] . "' 
        AND numes LIKE '%" . $_GET['numes'] . "%' 
    GROUP BY data_raport 
    HAVING TOT Total_Hours <= '8:00' ) T

该查询是grup所有结果是总计&lt; = 8:00小时,例如:

如果我有一个日期有多个作品一个5小时,第二个3小时,t 3个小时和四个5小时计数结果它将是2小时8但我想忽略如果总共o在一个日期工作超过8小时。感谢

0 个答案:

没有答案