SQL
共 3 篇文章
mysql的innodb引擎的count(*)陷阱
InnoDB Pitfalls However, all is not rosy with InnoDB. Because of its transactional nature, it has bottlenecks of its own. On MyISAM, doing a query that does SELECT COUNT(*) FROM {some_table}, is very fast, since MyISAM keeps the information in the index. On InnoDB, this info is not stored in an ind…
2010-02-05 17:28 · SQL
mysql delete where in 的恶心问题
delete from `t_goods` where fi_id in (select * from ( select fi_id from `t_goods` where fs_num is null and fs_name is null and fs_type is null and fs_using is null and fs_lifetime is null) b) delete from `t_goods` where fi_id in (select fi_id from `t_goods` where fs_num is null and fs_name is null …
2009-12-28 14:45 · SQL
一次性更改数据库中所有用户表名称
从网上下了一个系统,要想把数据库和项目中用到的整合到一起,不过会有重名发生 想把所有表都加上一个前缀,不过一个一个改又麻烦.就写了这个东西 declare curRt cursor for select [name] from sysobjects where xtype = 'U' and [name]<> 'dtproperties' declare @tn nvarchar(20),@sql nvarchar(2000) open curRt fetch curRt into @tn while @@fetch_status =0 begin select @sql = N'exec …
2009-03-04 16:29 · SQL