Sql Server添加單引號
阿新 • • 發佈:2018-01-03
問題 convert 分享圖片 單引號 .cn alt har top www.
" ‘ "(單引號)的運用:在sql server中,兩個" ‘ "(單引號)在拼接字符串的情況下運用,就是表示拼接上了一個" ‘ "單引號字符串。
SELECT TOP 1 ‘‘‘‘+CONVERT(nvarchar(50),keyid)+‘‘‘‘ name1 FROM Rel_ProductStockLock with (nolock) WHERE KeyId IS NOT NULL SELECT TOP 1 ‘‘‘‘+CONVERT(nvarchar(50),keyid)+‘‘‘,‘ name2 FROM Rel_ProductStockLock with (nolock) WHERE KeyId ISNOT NULL SELECT ‘‘‘‘ name3; SELECT ‘123‘‘‘ name4; SELECT ‘123‘+‘‘ name5; SELECT ‘"123"‘ name6; SELECT TOP 1 ‘123‘+AreaName name7 FROM dbo.Dim_Area; SELECT TOP 1 ‘123‘‘‘+AreaName name8 FROM dbo.Dim_Area; SELECT TOP 1 ‘123‘‘‘+AreaName+‘‘ name9 FROM dbo.Dim_Area; SELECT TOP 1 ‘123‘‘‘+AreaName+‘‘‘‘ name10 FROMdbo.Dim_Area;
https://www.cnblogs.com/zhaosw/p/6088040.html 關於sql 拼接字符串的問題
Sql Server添加單引號