T-SQL取时间的年月日
摘要:经常保存在SQL Server的datetime格式的数据都是带有时、分、秒等的。但是在页面读取的时候,通知只需要年月日,今天用到的读取时间年月日的方法如下:view plaincopy to clipboardprint?convert(varchar(12),时间列名,111)如在数据表table1中的列 operdate是datetime格式的,需要读取operdate的年月日的方法就是vi...
阅读全文
posted @
2010-08-25 19:25
Alan Yang
阅读(8331)
推荐(0)
How do work with NULL in TSQL
摘要:How do I work with NULL?NULL which can be tricky to work with and requires special treatment in a number of circumstances. In general, never assume that NULL will behave like a 0 in a numeric data fie...
阅读全文
posted @
2010-08-05 14:47
Alan Yang
阅读(394)
推荐(0)
两种数据库,四种分页算法的效率比较
摘要:转自:http://www.cnblogs.com/jyk/archive/2008/08/04/1260406.html分页算法本身没有什么快慢之分,对反应速度起到决定作用的是——能否有效地利用索引!算法 评价 缺点 适用的数据库 max效率最高的 只能有一个排序字段 Excel、Access、SQL Server 2000(2005) 颠倒Top适用范围最广的 最后一页...
阅读全文
posted @
2009-06-23 17:54
Alan Yang
阅读(519)
推荐(0)
sql 面试题--源于网络
摘要:Student(S#,Sname,Sage,Ssex) 学生表 Course(C#,Cname,T#) 课程表 SC(S#,C#,score) 成绩表 Teacher(T#,Tname) 教师表 问题: 1、查询“001”课程比“002”课程成绩高的所有学生的学号; select a.S# from (select s#,score from SC...
阅读全文
posted @
2009-06-23 10:05
Alan Yang
阅读(2207)
推荐(0)