Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

fetcht he leftmost word in a comma separated string in sql

SELECT SUBSTRING_INDEX(address, ',', 4) FROM employees;
+-----------+------------------------------------+
| name      | SUBSTRING_INDEX(address, ',', 4)   |
+-----------+------------------------------------+
| John Doe  | 4225 Collins Street,Apt. A,Erie,PA |
| Bob Smith | 234 Main Street,,Erie,PA           |
+-----------+------------------------------------+
Source by www.gyrocode.com #
 
PREVIOUS NEXT
Tagged: #fetcht #leftmost #word #comma #separated #string #sql
ADD COMMENT
Topic
Name
1+8 =