리자

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

· 14년 전 · 1426
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>
|
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
14년 전 조회 937
14년 전 조회 1,068
14년 전 조회 942
14년 전 조회 2,225
14년 전 조회 1,854
14년 전 조회 2,527
14년 전 조회 497
14년 전 조회 790
14년 전 조회 1,059
14년 전 조회 659
14년 전 조회 635
14년 전 조회 3,913
14년 전 조회 1,427
14년 전 조회 2,326
14년 전 조회 1,239
14년 전 조회 838
14년 전 조회 3,342
14년 전 조회 713
14년 전 조회 1,833
14년 전 조회 763
14년 전 조회 1,180
14년 전 조회 3,159
14년 전 조회 709
14년 전 조회 965
14년 전 조회 773