如何在SQL中按位置获取字符 [英] how to get character by position in SQL
本文介绍了如何在SQL中按位置获取字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有写查询
I have write query
DECLARE @set NVARCHAR(50)
set @set='a,b,c'
select FIND(@set)
我想按位置查找字符
如果我发送FIND(2),然后要根据我的查询dsiplay b ..
sql
I want to find the charcter by position
if i send FIND(2) then want to dsiplay b as per my query ..
Is there any function in sql
推荐答案
中是否有任何函数,您可以使用substring
函数.许多数据库都提供了它(尽管名称不同,例如MS Transact-SQL
具有 SUBSTRING [ ^ ],而Oracle
提供了 SUBSTR [
You may use thesubstring
function. Many database provide it (albeit with different names, for instanceMS Transact-SQL
has SUBSTRING[^], whileOracle
provides SUBSTR[^]).
这篇关于如何在SQL中按位置获取字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文