sql查询o清理数据 [英] sql query o cleanse data
本文介绍了sql查询o清理数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有数据
cd1234
v01234
我只需要从上面提取char数据,比如第一行的cd和第二行的v。
i need to extract only the char data from the above, like cd from the first row and v from the second row.
请任何人可以帮助查询
推荐答案
DECLARE @s varchar(20) = 'cd1234';
SELECT REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(@s, '0', ''), '1', ''), '2', ''), '3', ''), '4', '');
这篇关于sql查询o清理数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文