1.时间处理
DATEDIFF(minute,dateadd(n,25,dtCreate),dtToRiskControl)
datediff(m,t1,t2) 计算t2-t1的m差 m代表小时、分钟、秒等
dateadd(n,num,t) 代表时间t增加num分钟
_ueditor_page_break_tag_
参考:http://www.w3school.com.cn/sql/sql_dates.asp
2.distinct的用法
作用:去重
select count(distinct name) from A;
参考:http://www.cnblogs.com/rainman/archive/2013/05/03/3058451.html
3.多表关联删除
delete from Inf_Rush from Inf_Rush a left join inf_business b on a.businesscode=b.businesscode where b.CusName like '%测%' or b.sTabletnumber like '%测%'
4.多表关联查询
select * from Inf_Rush a left join inf_business b on a.businesscode=b.businesscode where b.CusName like '%测%' or b.sTabletnumber like '%测%'
5.新增字段
alter table Inf_BsiConfig add LoanDayMin int null, LoanDayMax int null