总结一些工作中用到或碰到的SQL语句,希望能与大家分享,同时也希望大家能提供更多的精妙SQL语句..... 1.delete table1 from (select * from table2) as t2 where table1.id=t2.id 2.truncate table table1 (不在事务日志中做记录,比delete table快,但不能激活触发器) 3.update table1 set column=column+1 where id=(select id from ta…
最近在加强sql 语句的学习,整理一下基本语法,现在记录下 select * from dbo.cangku where city='河南' select distinct(city), cangkuId from dbo.cangku //取消重复的列值 select SUM (gongzi) as zgz from dbo.zhigong //总工资 select cangkuId ,city from dbo.cangku where not city='河南'…