如何把IP地址中的.去掉? sql语句如何把IP地址中的.去掉?比如11.33.55.123 变成 113355123 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select replace('11.33.55.123','.','') declare @ip varchar(20)select @ip='11.33.55.123'SELECT @ip=REPLACE(@ip,'.','') select replace('127.0.0.1', '.', '') 那我这个数据是表里的比如表为xtable,字段名为ip,怎么办 --哈哈declare @ip varchar(20),@newip varchar(20),@L intselect @ip='11.33.55.123',@newip=''SELECT @L=len(@ip)while @L>0beginset @newip=@newip+case when left(right(@ip,@L),1)='.' then '' else left(right(@ip,@L),1) endset @l=@l-1endprint @newip select replace(ip,'.','') ip from xtable update xtable set ip=replace(ip, '.', '') 获取相同数据的各最新一条 关于Image字段保存图片,提示超过长度怎么解决? 菜鸟小弟的问题 数据表之间的连接问题(----------------在线等-----------------) 如何制作PDF电子书 SQL2005连接SQL2000错误,提示18456 SQL问题,不知道这功能可不可以实现 请高手指路:我从别人的机器上拷贝了SQLserver数据库,怎样在自己的计算机上打开它啊? SQL增量备份时间如何查询(外部程序、语言) 备份数据库时报错,什么原因? server 2000中怎样查询帐户? 请问有没有人能给我个union 函数的公式啊
select @ip='11.33.55.123'
SELECT @ip=REPLACE(@ip,'.','')
比如表为xtable,字段名为ip,怎么办
declare @ip varchar(20),@newip varchar(20),@L int
select @ip='11.33.55.123',@newip=''
SELECT @L=len(@ip)
while @L>0
begin
set @newip=@newip+case when left(right(@ip,@L),1)='.' then '' else left(right(@ip,@L),1) end
set @l=@l-1
end
print @newip