今天看到有些朋友问如何利用旧表创建新表,但很多朋友给的答案是不正确的。 像 create table newtable like oldtable; select * from oldtable into newtable; 这两种方法都不对,正确的方法是 select * into newtable from oldtable; 如果不想导记录,只想生成表结构 :select * into newtable from oldtable where 1=2; 如果newtable已存在,想导入记录:insert into newtable select * from oldtable where ... 有些也是借鉴一些其他朋友的,我在这总结一下,希望对大家有用。 祝:天天有个好心情!!
SQL中利用旧表创建新表
最新推荐文章于 2024-07-18 09:45:00 发布