리자

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

· 2011-08-31 (수) 10:21:42 · 1541
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>
|
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

6,077건

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

+
제목 글쓴이 날짜 조회
11-10-01 조회 775
11-09-30 조회 765
11-09-29 조회 871
11-09-26 조회 744
11-09-23 조회 796
11-09-23 조회 574
11-09-22 조회 1,126
11-09-09 조회 1,167
11-08-30 조회 2,442
11-08-23 조회 616
11-08-12 조회 877
11-08-04 조회 2,344
11-07-01 조회 1,428
11-06-09 조회 1,104
11-05-17 조회 1,181
11-05-07 조회 1,481
11-04-21 조회 1,229
11-04-12 조회 909
11-04-11 조회 2,157
11-02-11 조회 1,424
11-02-08 조회 819
11-01-11 조회 1,196
10-11-26 조회 2,500
10-09-25 조회 1,444
10-09-19 조회 1,509