SQL PHP HTML ASP JavaScript articles and free scripts to download
 

String functions

MySQL string functions we can use to manipulate data and derive useful information and analysis from the tables. These functions can be used along with update commands to change records or can be used to update multiple tables.

If you have a table of your newsletter subscribers and you want to know how many are using gmail then you have to work on the email address and extract the domain part from it. You may also like it see the all the email providers in a single list with number of subscribers. Such applications are possible by using mysql string functions.

We will discuss some of the string functions and develop some applications using them.

concat

We can use concat string function to add any string to all the data ( or restrict the data by where clause ) present in a field.

replace

We can use replace query to change a part of a string present ( or matching ) inside field.

locate

We can search for presence of a substring inside a string field.

LEFT

Left part of a string by using left function.

LPAD

Padding string from left using LPAD function.

character_length

Inside a varchar field we can get a list of number of chars used by each data.

reverse

String reverse function in Mysql.

repeat

repeat function in Mysql.

RPAD

Padding string from right using RPAD function in MySQL.

ucase lcase

lcase & ucase string functions to change upper to lower and lower to upper case of the string data

Sql like

We can use wildcard with LIKE command to match various patterns or combination of string data

substring_index

We can use this function to take out a substring from a main string by using a delimiter and count.



Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

Join Our Email List
Email:  
For Email Newsletters you can trust
MySQL String
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2013 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer