MySQL 성능 최적화 중 INNER JOIN ... USING 메모 정보
MySQL MySQL 성능 최적화 중 INNER JOIN ... USING 메모
본문
create table daily_hit_counter ( day date not null, slot tinyint unsigned not null, cnt int unsigned not null, primary key (day, slot) );
update daily_hit_counter as c inner join ( select day, sum(cnt) as cnt , min(slot) as mslot from daily_hit_counter group by day) as x using(day) set c.cnt = if(c.slot = x.mslot, x.cnt, 0), c.slot = if (c.slot = x.mslot, 0, c.slot);<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:27:00 MySQL에서 이동 됨]</div>
update daily_hit_counter as c inner join ( select day, sum(cnt) as cnt , min(slot) as mslot from daily_hit_counter group by day) as x using(day) set c.cnt = if(c.slot = x.mslot, x.cnt, 0), c.slot = if (c.slot = x.mslot, 0, c.slot);<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:27:00 MySQL에서 이동 됨]</div>
추천
0
0
댓글 0개