我如何获得I / P:Hello123 ... O / P:作为H123 [英] How Do I Get I/P:Hello123 ...O/P: As H123

查看:82
本文介绍了我如何获得I / P:Hello123 ... O / P:作为H123的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,我有一个任务,我是这个网站的新手你可以帮我快点



例如:i / p:Hello123 ... o / p:作为H123





使用Sql函数,例如





创建函数function_name



)...

as

begin

....

....

结束

sir i have a task i am new to this site can you help me fast

for e.g: i/p:Hello123 ...o/p: as H123


by using Sql functions like


create function function_name
(
)...
as
begin
....
....
end
Go

推荐答案

试试这个链接





http://stackoverflow.com/questions/9629880/extract-numbers-from-a-text-in-sql-server [< a href =http://stackoverflow.com/questions/9629880/extract-numbers-from-a-text-in-sql-servertarget =_ blanktitle =New Window> ^ ]



上面的链接将帮助您从字符串中提取数字。

在最终结果中,您需要添加第一个字符,即字符串中的H。



希望以上解决方案有助于。
Try this link


http://stackoverflow.com/questions/9629880/extract-numbers-from-a-text-in-sql-server[^]

The link above will help you to extract the numbers from your string.
In the final result you will need to add the first character i.e., "H" from your string.

Hope the above solution helps.


阅读这篇文章。它清楚地解释了使用SQL Server提取数字



并使用
Read this article. It explains clearly about Extracting numbers with SQL Server

and use
LEFT("Hello123", 1)

SUBSTRING("Hello123", 1, 1)

从字符串中提取第一个字母。然后你可以连接它们以获得所需的输出。

to extract first letter from your string.Then you can concatenate them to get the desired output.


这篇关于我如何获得I / P:Hello123 ... O / P:作为H123的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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