2011年9月15日

SQL 2005中合并多行记录为一条记录的方法总汇

摘要: CREATE TABLE tb(id int, [value] varchar(10))INSERT tb SELECT 1, 'aa'union ALL SELECT 1, 'bb'union ALL SELECT 2, 'aaa'union ALL SELECT 2, 'bbb'union ALL SELECT 2, 'ccc'--SELECT * FROM tb/**//*id value----------- ----------1 aa1 bb2 aaa2 bbb2 ccc(5 row(s) affect 阅读全文

posted @ 2011-09-15 18:43 Steven Wang's 阅读(303) 评论(0) 推荐(0) 编辑

2011年7月4日

转:【随记】SQL Server datetime convert

摘要: 【随记】SQL Server datetime convert SELECT convert(varchar, getdate(), 100) -- mon dd yyyy hh:mmAM (or PM) -- Oct 2 2010 11:01AM SELECT convert(varchar, getdate(), 101) -- mm/dd/yyyy - 10/02/2010 SELECT convert(varchar, getdate(), 102) -- yyyy.mm.dd - 2010.10.02 SELECT convert(varchar, getdate(), 103) - 阅读全文

posted @ 2011-07-04 17:38 Steven Wang's 阅读(453) 评论(0) 推荐(0) 编辑

导航