sql函数求助
有一字段
AA 数据为[email protected]
而我想取出的数据为nbcx.cn
请问大家该怎么处理
是否有函数能之直接得到@在[email protected]中的位置
——解决方案——————–
有
substring()
——解决方案——————–
楼上没理解
mysql不懂
用java的意思就是
先indexOf( "@ ")
然后在substring
——解决方案——————–
select substr(AA,position( '@ ' in AA)+1) from tablename
例如:
select substr( '[email protected] ',position( '@ ' in '[email protected] ')+1)
——解决方案——————–
set @test1 = '[email protected] ';
select substring(@test1,instr(@test1, '@ ')+1);