Home Tutorial Php Sql MySQL Append Data

 
 

MySQL Append Data
Posted on: December 9, 2010 at 12:00 AM
This example illustrates how to append data with a column value.

MySQL Append Data

This example illustrates how to append data with a column value.

In this example we use 'CONCAT' function to append data to the column value.

Table

+-----------+-----------+----------+----------------------------------+
| studentid | sectionid | courseid | time                             |
+-----------+-----------+----------+----------------------------------+
| 3         | 3         | 3        | Mon 14:30-16:00                  |
| 2         | 2         | 5        | Mon 11:30-12:00, Thu 09:00-11:00 |
| 1         | 1         | 6        | Mon 09:30-11:00                  |
+-----------+-----------+----------+----------------------------------+

Query

select studentid, CONCAT(studentid, 'sandeep') FROM mca;
Output
+-----------+------------------------------+
| studentid | CONCAT(studentid, 'sandeep') |
+-----------+------------------------------+
| 3         | 3sandeep                     |
| 2         | 2sandeep                     |
| 1         | 1sandeep                     |
+-----------+------------------------------+

Related Tags for MySQL Append Data:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.