随笔分类 - SQL
摘要:SELECT STUFF( (SELECT Distinct '|'+ProductCode FROM [chexian].[dbo].[ProxyServer] WHERE CompanyID=1069 FOR XML PATH('') ),1,1,'')
阅读全文
摘要:select * from [ProxyServer] where [CompanyID] in (select [CompanyID] from [ProxyServer] group by [CompanyID] having count(*)>1)
阅读全文
摘要:select T.*,P.ProductName from (select V.CompanyID,C.CompanyName,V.ProductCode from VehicleInsuranceAgentConfiguration V inner join Company C on V.CompanyID = C.CompanyID where V.IsDelete=0 and V.Ho...
阅读全文
摘要:1: SELECT TOP 1 P.* FROM [ProxyServer] P JOIN (SELECT RAND()*100 AS Nid) T ON P.[Id]>T.Nid WHERE P.Cookie'' and P.CompanyID=1069 and P.ProductCode='TPCX'2: SELECT TOP 1 * FROM [ProxyServer] WHE...
阅读全文
摘要://查询一个表中的某字段为条件修改另一个表的内容 update [VehicleInsuranceAgentConfiguration] set Keyword2=PC.ServerConfig from ProxyConfig PC,VehicleInsuranceAgentConfiguration VIAC where VIAC.CompanyID=PC.CompanyID and VI...
阅读全文
摘要:多线程处理sql server2008某个表中的数据时,在Update记录的时候出现了【Transaction (Process ID 146) was deadlocked on lock resources with another process and has been chosen as
阅读全文
摘要:UPDATE 表名 SET 字段名 = REPLACE (字段名, 'old', 'new');
阅读全文

浙公网安备 33010602011771号