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 Šî‘b•Ò (‚»‚̘Z) ƒe[ƒuƒ‹‘n¬ create tableAselectAunionArename

Šî–{“I‚É OracleASQL-ServerAMDB ‚Å‹¤’Ê‚Å‚·B

¡Šî–{Œ^

  create table sak.Žó’m (
    Žó’”ԍ†         char    (015)     primary key,
    •i”Ô             varchar2(018),
    Žó’”           number  (009),
    “¾ˆÓæCD         char    (004),
    XV’S“–ŽÒ       char    (007),
    XV“ú•t         char    (010),
    XVŽžŠÔ         char    (008)
  );

¡ƒRƒs[‘n¬

  create table sak.Žó’w1 as
    select * from sak.Žó’m where Žó’”ԍ† = '@';

  create table sak.Žó’w1 as
    select * from sak.Žó’m;

  create table sak.Žó’w1 as
    select Žó’”ԍ†, •i”Ô from sak.Žó’m;

  ** ƒe[ƒuƒ‹\‘¢‚ƃŒƒR[ƒh‚¾‚¯‚ªƒRƒs[‚³‚ê‚éB
  ** primary key ‚Ȃǂ̐®‡«‹K‘¥‚̓Rƒs[‚³‚ê‚È‚¢B
  ** ®‡«‹K‘¥‚ªƒRƒs[‚³‚ê‚È‚¢‚̂́Aƒ[ƒNƒe[ƒuƒ‹‚Ì‘n¬‚É“s‡‚ª—Ç‚¢B
  ** primary key ‚ÌŽw’肪•K—v‚ÈŽž‚́AŒã‚ŁAalter table ‚ŒljÁ‚·‚éB
  ** ‹ó‚̃e[ƒuƒ‹‚É‚µ‚½‚¢Žž‚́Aƒ[ƒŒ’Šo‚Æ‚È‚é‚悤‚È where ‹åðŒ‚ðŽw’è
     ‚·‚éB(where Žó’”ԍ† = '@' ‚ȂǁB)

¡•¡‡‘n¬

  create table sak.Žó’w1 as
    select * from sak.Žó’m
      where •i”Ô in
      (select distinct •i”Ô from sak.•i”Ôm where •i”Ô = 'a001')
    union all
    select * from sak.Žó’m
      where •i”Ô in
      (select distinct •i”Ô from sak.•i”Ôm where •i”Ô = 'a001')
  ;

  ** •i”Ô 'a001' ‚̃ŒƒR[ƒh‚ð 2 ‰ñ’Šo‚µ‚āAƒ[ƒNƒe[ƒuƒ‹‚Æ‚µ‚Ä‘n¬‚·‚éB
  ** d•¡ƒŒƒR[ƒh‚ðœ‹Ž‚·‚éê‡‚́Aunion all ‚Ì‘ã‚í‚è‚É union ‚Æ‚¾‚¯Žw’è
     ‚·‚éB

¡ƒe[ƒuƒ‹Aƒrƒ…[A‚»‚Ì‘¼–¼‘O•ÏX

  rename sak.Žó’w1 to sak.ƒSƒ~w1;

¡SQL Šî‘b•ÒŽ‘—¿
¡SQL Šî‘bŽÀ’n•ÒŽ‘—¿
¡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