Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server split string last

SELECT SUBSTRING( string , LEN(string) -  CHARINDEX('/',REVERSE(string)) + 2  , LEN(string)  ) FROM SAMPLE;
Comment

Split string and get first and last element in sql server

DECLARE @String nvarchar(200) = 'I_love_my_country'

SELECT left(@String, charindex('_', @String) - 1) AS first_element 
SELECT reverse(left(reverse(@String), charindex('_', (reverse(@String))+'_' ) -1)) AS last_element 
Comment

PREVIOUS NEXT
Code Example
Sql :: sql max of two values 
Sql :: minus in sql 
Sql :: find all tables with column name 
Sql :: sql greater than 
Sql :: how to count the number of rows in sql 
Sql :: sql get first letter of string 
Sql :: how to upper case in sql 
Sql :: how to find unique element in sql 
Sql :: ON DUPLICATE KEY UPDATE for postgres 
Sql :: sql delete duplicate rows 
Sql :: How to insert Arabic characters into SQL database 
Sql :: command to give readonly access to a postgres sql user 
Sql :: SQL Copy to Another Database 
Sql :: query to delete a database in mysql 
Sql :: oracle parameter 
Sql :: oracle last modification in table 
Sql :: add clumn to table postgres 
Sql :: timestamp difference sql 
Sql :: auto increment in postgresql 
Sql :: oracle avg 
Sql :: how to connect to postgres 
Sql :: test sql query 
Sql :: sql tabelle erstellen 
Sql :: difference between normalization and denormalization 
Sql :: how to delete database in mysql 
Sql :: porcentaje sql 
Sql :: delete all duplicate rows keep the latest except for one in mysql 
Sql :: return the number of records in a single table mysql 
Sql :: mysql default port number 
Sql :: mysql search replace 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =