sql表的字段中,怎么查询有特殊标记符号的内容
1个回答
展开全部
create table tb(经度 varchar(20))
insert into tb values('93.3901')
insert into tb values('93.390392')
insert into tb values('93.3905')
insert into tb values('93.3906')
insert into tb values('93.39.7332')
insert into tb values('93.39.8904')
go
select case when parsename(经度,3) is null then parsename(经度,2) + '.' + parsename(经度,1)
else parsename(经度,3) + '.' + parsename(经度,2) + parsename(经度,1)
end 经度
from tb
drop table tb
/*
经度
----------------
93.3901
93.390392
93.3905
93.3906
93.397332
93.398904
(所影响的行数为 6 行)
*/
insert into tb values('93.3901')
insert into tb values('93.390392')
insert into tb values('93.3905')
insert into tb values('93.3906')
insert into tb values('93.39.7332')
insert into tb values('93.39.8904')
go
select case when parsename(经度,3) is null then parsename(经度,2) + '.' + parsename(经度,1)
else parsename(经度,3) + '.' + parsename(经度,2) + parsename(经度,1)
end 经度
from tb
drop table tb
/*
经度
----------------
93.3901
93.390392
93.3905
93.3906
93.397332
93.398904
(所影响的行数为 6 行)
*/
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询