SAK }‘ŠÙ

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠÙEƒJƒtƒF ˆê—— SAK Streets ŒŸõ
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

SQL ƒ}[ƒW - MERGEAusingAmatchedAnot matched (Oracle9i ˆÈ~)

¡ƒ}[ƒW(MERGE) (Oracle9i ˆÈ~)

  E–â‚¢‡‚킹Œ‹‰Ê‚ŁA’ljÁAXV‚ªs‚¦‚éB
    ‚¢‚í‚ä‚éƒ}ƒbƒ`ƒ“ƒO‚âƒ}[ƒWˆ—‚ªŠÈ’P‚ɍs‚¦‚Ä•Ö—˜‚©‚àB
    ŽŸ‚Ì—á‚ł́AŽó’m ‚Ì•i”Ô–ˆŽó’”Œv‚ð•i”Ôm ‚É•i”Ô‚ª‘¶Ý‚·‚ê‚΁A—ݐÏ
    XV‚µA‘¶Ý‚µ‚È‚¯‚ê‚ΒljÁ‚µ‚Ä‚¢‚éB
    ‚ ‚Ü‚è—Ç‚¢—á‚Å‚Í‚È‚¢‚ªA•µˆÍ‹C‚͂‚©‚ß‚Ü‚·B

  merge into •i”Ôm a using
    (select •i”Ô, sum(Žó’”) Žó’” from Žó’m group by •i”Ô) b
    on (a.•i”Ô = b.•i”Ô)
    when matched then
      update set a.Žó’” = a.Žó’” + b.Žó’”
    when not matched then
      insert (•i”Ô, Žó’”) values (b.•i”Ô, b.Žó’”)
  ;

¡SQL Šî‘bŽÀ’n•ÒŽ‘—¿
¡SQL Šî‘b•ÒŽ‘—¿
¡SQL ƒ`ƒ…[ƒjƒ“ƒO•ÒŽ‘—¿
¡Oracle PL/SQL •ÒŽ‘—¿
¡PostgreSQL •ÒAJAVA ServletAJSP •ÒŽ‘—¿
¡MySQL •ÒŽ‘—¿
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠÙEƒJƒtƒF ˆê—— SAK Streets ŒŸõ



Copyright (C) 1999-2017 Y.SAK