摘要:
1.定义委托 : 方法定义前 加 delegate public delegate void NoReturnNoPara(); public delegate void NoReturnWithPara(int x, int y);//1 声明委托 public delegate int With 阅读全文
摘要:
需要包括有几种情况一、A表中有的字段B表无二、B表有的A表无三、两个表字段名不一致的 如果只对比字段名,可以这样 一、A表中有的字段B表无select name from syscolumns where id=object_id('A') and name not in(select name f 阅读全文
摘要:
1. 统计各个条件下的数据 select BatchId,sum(CardSum) 总金额, sum(case when Status=1 then CardSum else 0 end) as 已使用, sum(case when Status=2 then CardSum else 0 end) 阅读全文
摘要:
1.对查询进行优化,要尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: select id from t where num is null 最好不 阅读全文