Search
 
SCRIPT & CODE EXAMPLE
 

SQL

fetch second word from a string in ms sql

-- Example there is a column FULL_NAME which contains two words like "Bob Dylan"
-- To fetch second word "Dylan" we will use space as a divisor 
-- and take 10 signs after space
SELECT SUBSTRING(FULL_NAME, (SELECT CHARINDEX(' ', FULL_NAME)+1), 10) 
FROM TABLE_NAME;
Comment

PREVIOUS NEXT
Code Example
Sql :: sql workbench 
Sql :: bus source and destination equal to destination and source of another by sql query 
Sql :: sql group by and having 
Sql :: check records older than 10 days 
Sql :: divide database into structured tables 
Sql :: SQL Injection Using Always True Condition 
Sql :: how to make full text search dynamic in mysql 
Sql :: sql random date between two dates 
Sql :: create table with error 
Sql :: add mysql database to power bi web 
Sql :: postrgres trunc 
Sql :: sql create tablwe 
Sql :: sql comparison operators 
Sql :: http_user agent vers SQL 
Sql :: sql start with vowels 
Sql :: hex string sql becomes int64 
Sql :: umgebungsvariable setzen für mysql 8 
Sql :: select all fields from table 
Sql :: SQLAlchemy query to return only n results? 
Sql :: sql query for login with email or username 
Sql :: power query case when 
Sql :: hibernate xml property MySQL url, username and password 
Sql :: SQL create table full of dates 
Sql :: sql get latest of 2 datetimes 
Sql :: select A from B join C as D using E where F match G order by H desc 
Sql :: 10 random questions use python and SQL 
Sql :: dbt unique key 
Sql :: subquery 
Sql :: java.sql.sqlexception: access denied for user 
Sql :: parsing float to int in mysql 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =