高级搜索 返回首页  
名人名言
技术文章
山阴客技术文章oracle中的select into & insert into
oracle中的select into & insert into
2020-12-03 8:58:38
by 技术文章  
Rating: not rated yet
1 2 3 4 5 6 7 8 9 10

oracle中的select into & insert into


以前用sqlserver时习惯用 select * into tablename1 from tablename2 where ... 来复制表结构和数据。今天在用oracle时,需要复制表结构和数据,不加思索地写了同上的语句,结果报错,缺少关键字。
  select into 的用法结构是

SELECT [DISTICT|ALL]
INTO (variable[,variable,...] |record)
FROM [alias]
WHERE......

  能类似实现此功能的语句有create table table1 as select * from table2 这句是先创建一个表,再复制结构和数据过去。

  还有个就是insert into table1 select * from table2 where...   实现上面同样的功能。

推荐给好 src="images/mail.gif" align=absMiddle border=0> 打包下载这篇文章 打印这篇文章

  showcomment   there are 0 comment
subject:
name:E-mail


Copyright © 2002 http://www.shanyinke.com
All rights reserved.

备案号:浙ICP备17002154号-3 Powered by: MyArticle Version 1.0dev
Processed Time: 0.0027 s Querys: 5 [ Gzip Level 0 ]