2010年4月2日

SQL 扫描参数(SARG)

摘要: 改善SQL语句 很多人不知道SQL语句在SQL SERVER中是如何执行的,他们担心自己所写的SQL语句会被SQL SERVER误解。比如: select * from table1 where name='zhangsan' and tID > 10000和执行: select * from table1 where tID > 10000 and name='zhangsan' 一... 阅读全文

posted @ 2010-04-02 17:49 laodao1 阅读(239) 评论(0) 推荐(0) 编辑

sql中Convert和Cast 用法总结

摘要: 时间--》》字符串 select Convert(char(10),getdate(),112)select Cast(getdate() as varchar(10))字符串--》》时间select Cast('20100305' as datetime)select Convert(datetime,'20100305')总结:我发现Convert一个就够用了,而且挺好的。 阅读全文

posted @ 2010-04-02 15:15 laodao1 阅读(921) 评论(0) 推荐(0) 编辑

SQL 查询某天的数据

摘要: 查询 2010-03-25 的数据代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--select*fromscore_getwheresubstring(Convert(char(10),get_time,112),1,8)='20100325'se... 阅读全文

posted @ 2010-04-02 13:17 laodao1 阅读(11023) 评论(0) 推荐(0) 编辑

导航