본문 바로가기
데이타베이스

MYSQL group by 의 예

by 세이박스 2008. 10. 9.
반응형

$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 ";

반응형