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 tableAselectAunionArename

Šî–{“I‚É OracleASQL-ServerAMDB ‚Å‹¤’Ê‚Å‚·B

¡Šî–{Œ^

  create table sak.Žó’m (
    Žó’”Ô†         char    (015)     primary key,
    •i”Ô             varchar2(018),
    Žó’”           number  (009),
    “¾ˆÓæCD         char    (004),
    XV’S“–ŽÒ       char    (007),
    XV“ú•t         char    (010),
    XVŽžŠÔ         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 ServletAJSP •ÒŽ‘—¿
¡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-2024 Y.SAK