摘要:
问题描述:无论是在sql 2000,还是在 sql 2005 中,都没有提供字符串的聚合函数,所以,当我们在处理下列要求时,会比较麻烦:有表tb, 如下:idvalue----- ------1 aa1 bb2 aaa2 bbb2 ccc需要得到结果:id values------ --------... 阅读全文
摘要:
declare @Result nvarchar(Max) declare @AuthorityZone nvarchar(Max)='' declare @Apply_Type nvarchar(50)='' declare @ProductCode nvarchar(50)='' se... 阅读全文
摘要:
declare @rnd nvarchar(50)set @rnd =''while LEN(@rnd)<20 begin set @rnd =@rnd + REPLACE ( CONVERT(nvarchar, RAND ()),'0.','') while LEFT(@rnd,1)='0' se... 阅读全文
摘要:
1. insert into 表(列1,列2) select 列1,列2 from 表2 where....2.select * into 表2 from 表 1where...上面写法标识将表1的数据插入表2中,在运行完毕这条语句后,表2 在执行该SQL 语句钱表2 已经存在了 则报错。即:该跳语... 阅读全文