标签: sql sql-server sql-server-2008 sql-server-2012
如何从SQL Server中的A$B$C$D字符串中获取A%B%C%D或A$$$B$$$$$$C$$$$$$$$$D?
A$B$C$D
A%B%C%D
A$$$B$$$$$$C$$$$$$$$$D
答案 0 :(得分:8)
试试这个:
DECLARE @col VARCHAR(MAX) = 'A$$$B$$$$$$C$$$$$$$$$D' SELECT REPLACE(REPLACE(REPLACE(@col, '$', '{}'), '}{', ''), '{}', '$')