안녕하세요..
MySQL 관련 문의가 있습니다.
먼저, alert 테이블과 sc_tran 테이블이 있습니다.
alert 테이블에서 MMESSAGE와 SOURCE의 값을 sc_tran 테이블에 있는 TR_MSGTYPE에 넣고 싶습니다.
가능합니까?
가능하다면 자세한 해결 방법 좀 가르쳐 주세요..
DB에 대해 하나도 모르는 상태에서 할려니 힘듭니다.
insert [ignore] into sc_tran ( TR_MSGTYPE ) select concat(A.MMESSAGE , A.SOURCE ) from alert as A where ....
임의로 2 column 의 값을 string concatination 했는데, 이것이 아니라면 알아서 잘 처리하시면 될 것입니다.
http://dev.mysql.com/doc/refman/5.0/en/insert-select.html
5.0 기준 문법이지만 몇가지 보조적인 명령어를 제외하고는 4.1 에서도 잘 동작합니다.
( 4.0 이하는 저도 drived insertion 을 안해봐서 잘 모르겠습니다. )
Neogeo - Future is Now.
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
insert [ignore] into sc_tran
insert [ignore] into sc_tran ( TR_MSGTYPE ) select concat(A.MMESSAGE , A.SOURCE ) from alert as A where ....
임의로 2 column 의 값을 string concatination 했는데, 이것이 아니라면 알아서 잘 처리하시면 될 것입니다.
http://dev.mysql.com/doc/refman/5.0/en/insert-select.html
5.0 기준 문법이지만 몇가지 보조적인 명령어를 제외하고는 4.1 에서도 잘 동작합니다.
( 4.0 이하는 저도 drived insertion 을 안해봐서 잘 모르겠습니다. )
Neogeo - Future is Now.
Neogeo - Future is Now.
댓글 달기