摘要:
select CONVERT(varchar, getdate(), 120 )2004-09-12 11:06:08select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')20040912110608select CONVERT(varchar(12) , getdate(), 111 )2004/09/12select CONVERT(varchar(12) , getdate 阅读全文
摘要:
EG:SELECT TOP 5 md.ID,md.DepartName,md.OrganID,md.LastEditDate FROM mdDepartment md1 总经办 40 2009-06-24 16:21:52.4502 广告商务部 03 2009-06-24 16:22:02.8273 品牌商务部 02 2009-06-24 16:22:08.2804 客户发展部 04 2009-06-24 16:22:13.5305 增值三部 NULL 2009-11-05 14:20:31.750SELECT TOP 5 md.ID,md.DepartName,md.OrganID,md.L 阅读全文
摘要:
1.通过SQL拼写出要显示字符串:SELECT * ,(sa.AnswerContent+'<BR/>'+ISNULL(saaaa.XMLAnswerContent,'')) AS XMLAnswerContent2FROM SeAnswer saJOIN mdList ml ON sa.AnswerType=ml.[value]AND ml.[type]='AnswerType'AND sa.AnswerType = ISNULL(@AnswerType,sa.AnswerType)AND sa.AnswerContent LIKE 阅读全文
摘要:
select t1.*,row_number() over(order by fname) fname1from tablename 阅读全文
摘要:
DECLARE @ModelsXml XML,@ids VARCHAR(100)SET @ids='123@3,223@4,323@5'set @ModelsXml=' <root> <v><aa>'+REPLACE(REPLACE(@ids,',','</bb></v><v><aa>'),'@','</aa><bb>')+'</bb> </v> </ro 阅读全文