34,590
社区成员
发帖
与我相关
我的任务
分享
--这样。。
declare @t table(va varchar(10))
insert into @t select '34〇23'
insert into @t select 'sdafsadf'
select replace(va collate chinese_prc_bin,'〇','零') from @t
select replace('字段',N'〇',N'被这个字段代替') from tbname
declare @t table(va varchar(10))
insert into @t select '34〇23'
insert into @t select 'sdafsadf'
select replace(va,'〇','') from @t collate chinese_prc_bin
declare @t table(va varchar(10))
insert into @t select '34〇23'
insert into @t select 'sdafsadf'
select * from @t where replace(va,'〇','') collate chinese_prc_bin
select * from tb where charindex(字段名,'〇')>0
select * from table where patindex('['+nchar(63)+nchar(12295)+']',Name)=0
--测试数据
DECLARE @t TABLE (ID INT, MARK NVARCHAR(10))
INSERT INTO @t
SELECT 1,'〇' UNION ALL
SELECT 2,'〇' UNION ALL
SELECT 3,'〇' UNION ALL
SELECT 4,'B' UNION ALL
SELECT 5,'〇' UNION ALL
SELECT 6,'A'
SELECT * FROM @t WHERE MARK='〇'
UPDATE @t SET MARK=REPLACE(MARK,'A','〇')
SELECT * FROM @T
GO
ID MARK
----------- ----------
1 〇
2 〇
3 〇
5 〇
(4 row(s) affected)
(6 row(s) affected)
ID MARK
----------- ----------
1 〇
2 〇
3 〇
4 B
5 〇
6 〇
(6 row(s) affected)
--排序规则的原因:
declare @t table(va varchar(10))
insert into @t select '34〇23'
insert into @t select 'sdafsadf'
select * from @t where va like '%〇%'
--结果:
va
----------
34〇23
sdafsadf
select * from @t where va like '%〇%' collate chinese_prc_bin
--结果:
va
----------
34〇23
select * from tb where charindex(N'〇' , col) > 0
select replace(列,'〇','') from tbname