1. SQL将一个表中的某一列值全部插入到另一个表中 插入的话: insert into a(col) select col from b; 更新的话: update a set col=select col from b where a.id=b.id; 判断表是否存在数据库中,存在就删除 if exists (select * from Sysobjects where name='temp') begin drop table temp end insert into a(columen…
总结: 1.计算某列值(数值or字符串)重复的次数 select 列1,count( 列1 or *) count1 from table1 group by 列1 输出的表为:第一列是保留唯一值的列1,第二列是count1列的统计表. 问:那怎么把其他列信息也都显示出来呢?可以参考:http://www.myexception.cn/oracle-develop/1767413.html 我这里自己做一个总结,进入下一步.2.一张表中增加一列计算某列值重复的次数列,并且把表中其他列也显示出…