posts - 431,  comments - 344,  trackbacks - 0
          公告
           Don't Repeat Yourself
          座右銘:you can lose your money, you can spent all of it, and if you work hard you get it all back. But if you waste your time, you're never gonna get it back.
          公告本博客在此聲明部分文章為轉摘,只做資料收集使用。


          微信: szhourui
          QQ:109450684
          Email
          lsi.zhourui@gmail.com
          <2008年9月>
          31123456
          78910111213
          14151617181920
          21222324252627
          2829301234
          567891011

          留言簿(15)

          隨筆分類(1019)

          文章分類(3)

          文章檔案(21)

          收藏夾

          Link

          好友博客

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 860071
          • 排名 - 44

          最新評論

          閱讀排行榜

          問題
          要創建新表, 該表與已有表的列設置相同. 例如, 想要一個dept表的副本, 名未dept_2, 淡只是想復制表結構而不想復制源表中的記錄.

          解決方案
          DB2
          使用帶有like子句的create table命令:
              create table dept_2 like dept

          Oracle, MySQL 和 PostgreSQL
          在create table命令中, 使用一個不返回任何行的子查詢:
              create table dept_2
              as
              select * from dept where 1=0

          SQL Server
          使用帶有不返回任何行的查詢和into子句:
              select * into dept_2 from dept where 1=0
          posted on 2008-09-04 22:34 周銳 閱讀(236) 評論(0)  編輯  收藏 所屬分類: MySQL 、OracleSQL Server
          主站蜘蛛池模板: 祁东县| 平泉县| 崇仁县| 疏勒县| 盖州市| 密云县| 黄石市| 乌苏市| 沭阳县| 循化| 凭祥市| 高雄市| 双鸭山市| 万盛区| 历史| 孝义市| 阜城县| 商都县| 集贤县| 金寨县| 都江堰市| 四川省| 江永县| 合肥市| 阳高县| 乌苏市| 蓬溪县| 芜湖县| 永济市| 施甸县| 获嘉县| 永年县| 思茅市| 常州市| 鲁甸县| 奎屯市| 五河县| 海南省| 甘孜县| 达日县| 浦城县|