现在的位置: 首页 > 综合 > 正文

SQL优化积累

2014年04月27日 ⁄ 综合 ⁄ 共 158字 ⁄ 字号 评论关闭

--2013年11月12日 19:17:44

1.删除重复记录

delete from emp e where e.rowid>( select min(x.rowid) from emp x where x.empno=e.empno);

2.删除全表的时候用truncate

3.用where 代替having  后者是在检索出所有数据后才进行过滤。

抱歉!评论已关闭.