gpt4 book ai didi

sql-server - 确定列值字符串是否以数字开头

转载 作者:行者123 更新时间:2023-12-02 14:12:25 26 4
gpt4 key购买 nike

我有一个表问题,其中有一列描述。它的列值是这样的:

This is First Heading, 
1 This is Subheading one,
1.2 This is subheading Question
This is Second heading
2 This is subheading Two.
2.1 This is Subheading Question1

如何确定每一行的列值是否以数字 0-9 开头?

最佳答案

SELECT CASE WHEN ISNUMERIC(SUBSTRING(LTRIM(Description), 1, 1)) = 1 
THEN 'yes'
ELSE 'no'
END AS StartsWithNumber
FROM Questions

关于sql-server - 确定列值字符串是否以数字开头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10243852/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com