

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can CONCAT() function be applied on columns of MySQL table?
<p>We can use CONCAT() function to combine the values of two or more columns. In this case, the arguments of the CONCAT() functions would be the name of the columns. For example, suppose we have a table named ‘Student’ and we want the name and address of the student collectively in one column then the following query can be written −</p><pre class="prettyprint notranslate">mysql> Select Id, Name, Address, CONCAT(ID,', ',Name,', ', Address)AS 'ID, Name, Address' from Student; +------+---------+---------+--------------------+ | Id | Name | Address | ID, Name, Address | +------+---------+---------+--------------------+ | 1 | Gaurav | Delhi | 1, Gaurav, Delhi | | 2 | Aarav | Mumbai | 2, Aarav, Mumbai | | 15 | Harshit | Delhi | 15, Harshit, Delhi | | 20 | Gaurav | Jaipur | 20, Gaurav, Jaipur | +------+---------+---------+--------------------+ 4 rows in set (0.00 sec)</pre>
- Related Questions & Answers
- How MySQL CONCAT() function, applied to the column/s of a table, can be combined with the column/s of other tables?
- How can CONCAT() function be used with MySQL WHERE clause?
- How wildcard characters can be used with MySQL CONCAT() function?
- How can we remove composite PRIMARY KEY constraint applied on multiple columns of an existing MySQL table?
- Discuss how the sort function can be applied on NumPy arrays in Python?
- How can we set PRIMARY KEY on multiple columns of a MySQL table?
- How can we set PRIMARY KEY on multiple columns of an existing MySQL table?
- How can we apply BIT_LENGTH() function on the column/s of MySQL table?
- How can column data values of a table be compared using MySQL STRCMP() function?
- How can we use MySQL ALTER TABLE command for adding comments on columns?
- How can text vectorization be applied on stackoverflow question dataset using Tensorflow and Python?
- How can we list all the columns of a MySQL view as we can list the columns of a MySQL table?
- How can we add values into the columns of a MySQL table?
- How to can I get the names of my MySQL table columns?
- What kind of indexing can be done on a PostgreSQL table?
Advertisements