我有一个包含下一列的表格:
ID | Date | Hours |
1 20-05-2013 8:00
2 20-05-2013 2:00
如果日期相同,我想求和重复的时间。
$sql2=mysql_query("SELECT count(distinct data_raport), SUM(ore) as TOTAL FROM sohy_works WHERE data_raport BETWEEN '".$_GET['data']."' AND '".$_GET['data-2']."' AND numes LIKE '%".$_GET['numes']."%' AND ore <= '8:00' GROUP BY data_raport ");
while ($row2=mysql_fetch_array($sql2)) {
$total = $row2[0];
echo "8 hours/day: " . $total;
}
我想打印工作 8 小时的总天数。结论必须是 0 个工作日和 8 小时,因为报告具有相同的日期(同一天)