留言与评论(共有 0 条评论) |
发布时间:2020-04-15 16:51:54
如果表A存在:
insert into 表A(字段1,字段2) select 字段1,字段2 from 表B where
如果表A不存在(新建一个表A)
select 字段1,字段2 into 表A from 表B where
注意插入a的相应列名时取b值也要相对应。
select name from syscolumns where id in (select id from sysobjects where type = 'u' and name = '相应表名')
用以上sql语句输入相应表名就可以查到表的字段名,对应好数据库 查询是否存在该表语句
建索引脚本:
create clustered index 索引名 on 表名(表.字段)
在表增加一个字段,例如fa字段
alter table 表名 add fa int not null default 0
两个表应该有一个相同字段idH吧,所以可以用关联;
=U.amount
from class A inner join (select ,) from U ) U on A. idH=B.idH
如果表A存在:
insert into 表A(字段1,字段2) select 字段1,字段2 from 表B where
如果表A不存在(新建一个表A)
select 字段1,字段2 into 表A from 表B where
留言与评论(共有 0 条评论) |
全站搜索