I have a table Questions
with a column Description
. Its column values are like this:
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
How can I determine, for each row, if its column value starts with a number 0-9?
SELECT CASE WHEN ISNUMERIC(SUBSTRING(LTRIM(Description), 1, 1)) = 1
THEN 'yes'
ELSE 'no'
END AS StartsWithNumber
FROM Questions
SELECT * FROM Questions WHERE Description LIKE '[0-9]%'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With