如何在SQL中按位置获取字符 [英] how to get character by position in SQL

查看:87
本文介绍了如何在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 the substring function. Many database provide it (albeit with different names, for instance MS Transact-SQL has SUBSTRING[^], while Oracle provides SUBSTR[^]).


这篇关于如何在SQL中按位置获取字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆