Categories
February 2012
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Archive view more
RSS Feed
Mysql concat function
SEP
07
If you haven't used the concat() function in mysql you are missing out. It allows you to do selects and updates ( as well as other things ) using a concatenation of either columns, fields or both.
For example, you have a database table of users. This table has two columns one for first name and one for last name. You'd like to concat the fields together and return it as a single column full name. You can use a query like:
select concat(first_name,' ',last_name) as full_name from user
It is also useful in many other situations, as you will see during your programming excursions.
Comments
Be the first to leave a comment on this post.

