세이박스

'group by'에 해당되는 글 1건

  1. MYSQL group by 의 예

MYSQL group by 의 예

데이타베이스

$query="SELECT ex_id, sum(0h) as 0h, sum(1h) as 1h, sum(2h) as 2h, sum(3h) as 3h, sum(4h) as 4h, sum(5h) as 5h, sum(6h) as 6h, sum(7h) as 7h, sum(8h) as 8h, sum(9h) as 9h, sum(10h) as 10h, sum(11h) as 11h, sum(12h) as 12h, sum(search_total) as search_total from log_backup where search_date>='$pre_date' and search_date<='$next_date' group by ex_id ";