当前位置:主页>仓库管理软件> 列表

如何将以下查询得出的值插入到一个新表中 找会计电算化考试软件

库存管理软件版1楼: select * from table1 where tel in(select tel from table1 group by tel having count(*)>1 )

我现时想将以上执行后的结果,插入到一新表c中,请问怎么into 到c 表中?

2楼: select * from table1 INTO C
where tel in(select tel from table1 group by tel having count(*)>1 ) 如会计电算化考试软件

3楼: 楼上的兄弟,写错了吧……
select * into NewTable from table1 where tel in(select tel from table1 group by tel having count(*)>1 )

4楼: insert into newtablename select * from table1 where tel in(select tel from table1 group by tel having count(*)>1 )

5楼: 楼上的正解

6楼: 不好意思,写错。
多谢楼上‘寂寞的鸭子‘兄纠正

库存管理软件版7楼: 你们估计搞错了,楼主的新表估计是已经存在了,你们写的是新生成的表。
你们编程序的时候,会用sql生成表,然后对新生成的表操作吗?肯定不会。
哪么哪个表一定已经存在,
应该是这样的:
insert into 表1 (字段名列表) select 字段名列表 from 表2 where 条件
字段名列表一一对应,可能不写,但是他会自动对号入座,准确率就不得而知啦。

8楼: 看看