테스트 사이트 - 개발 중인 베타 버전입니다

MySQL 성능 최적화 중 INNER JOIN ... USING 메모

· 14년 전 · 1440
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>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시판 목록

프로그램

글쓰기