리자

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

· 14년 전 · 1430
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년 전 조회 944
14년 전 조회 1,075
14년 전 조회 951
14년 전 조회 2,232
14년 전 조회 1,861
14년 전 조회 2,532
14년 전 조회 505
14년 전 조회 798
14년 전 조회 1,066
14년 전 조회 664
14년 전 조회 639
14년 전 조회 3,920
14년 전 조회 1,431
14년 전 조회 2,333
14년 전 조회 1,247
14년 전 조회 843
14년 전 조회 3,348
14년 전 조회 719
14년 전 조회 1,841
14년 전 조회 769
14년 전 조회 1,186
14년 전 조회 3,168
14년 전 조회 718
14년 전 조회 972
14년 전 조회 780