Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Split alphanumeric string into numeric and alpha parts in SQL Server, ...
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
--Sql Server 2014 Express Edition --Batches are separated by 'go' DECLARE @str VARCHAR(MAX) = '4000 ug/ML' SELECT LEFT(@str, PATINDEX('%[0-9][^0-9]%', @str )) AS Number, LTRIM(RIGHT(@str, LEN(@str) - PATINDEX('%[0-9][^0-9]%', @str ))) As Unit
View schema
Execution time: 0 sec, rows selected: 2, rows affected: 0, absolute service time: 0,16 sec
edit mode
|
history
Number
Unit
1
4000
ug/ML