SQL Query | How to Extract Numbers and Alphabets from an alphanumeric string | Translate function

SQL Query | How to Extract Numbers and Alphabets from an alphanumeric string | Translate function

Learn at Knowstar

3 года назад

35,794 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Anderson Nunes
Anderson Nunes - 04.08.2023 18:21

Just Perfect!!!

Ответить
Monali Kharabe
Monali Kharabe - 24.05.2023 18:35

Awesome thank you so much....

Ответить
Naveen Kumar K
Naveen Kumar K - 01.05.2023 11:49

🎉🎉 super stuff

Ответить
kidzTube7
kidzTube7 - 28.04.2023 10:38

Making it bit simpler:

Declare @v varchar(100);
set @v='576SDJASL78JKFD90';
Select replace(translate(@v,'0123456789',' '),' ',''),
replace(translate(@v,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmopqrstuvwxyz',
' '),' ','')

Result:

SDJASLJKFD | 5767890



Ziakhan

Ответить
Rajiv Jani
Rajiv Jani - 06.01.2023 04:30

Excellent! Thanks for sharing!

Ответить
SARATH CHANDRA
SARATH CHANDRA - 12.12.2022 08:15

If this is the case we can simply use left and right operators in sql to seperate please solve the same when alphanumeric string is combined as'xas123ssh333'.

Ответить
SEEMA KUMARI
SEEMA KUMARI - 07.12.2022 11:27

Thank you so much mam, it is very helpful video and please provide us create and insert query ,it will help us for practice

Ответить
Akshay Pathania
Akshay Pathania - 16.11.2022 12:01

Very help full

Ответить
YO
YO - 02.10.2022 20:38

Could we have used the Patindex function as well ?

Ответить
SHAZAN KHAN
SHAZAN KHAN - 27.09.2022 10:15

Error -

The second and third arguments of the TRANSLATE built-in function must contain an equal number of characters.

Ответить
ESR👍
ESR👍 - 01.09.2022 19:25

Thank you

Ответить
j k
j k - 31.08.2022 18:04

Is this query worked in ORACLE 11g

Ответить
MethodOverRide
MethodOverRide - 17.08.2022 04:31

Awesome video!!!!

Ответить
Chitti babu
Chitti babu - 19.04.2022 09:52

For the same data can we sperate alphanumeric by -
Eg: AB-34-HP

Ответить
Autumn Banks
Autumn Banks - 23.03.2022 20:43

Thank you so much! This is exactly what I was looking for!

Ответить
Suraj Patil
Suraj Patil - 02.11.2021 07:55

Amazing explanation mam 👏

Ответить
Raja SEKAR P.V.
Raja SEKAR P.V. - 20.08.2021 03:50

Tablename-SQL
Column name-NAME
PRA9798VIN
RA556JA
VICK989Y

Ответить
demiphotomode
demiphotomode - 26.07.2021 23:30

Your video helped so much. Thank you!

Ответить
Motivation mindset
Motivation mindset - 21.05.2021 07:24

Hi, How do you separate alphabets from this data for example A256-20G, A658-78L, G588-100ML, I just only pull unit only (G, ML, L). any solution?

Ответить