How would you feel if I could show you how to earn your monthly income with only a couple hours prep work a month?
Read more to see the details...
From: mr zoab
10 years ago
This blog will show or teach you some basic SQL syntax used in various kinds of database
Here I will show you how to do string concatenation in MySQL select statement.
Assume you have a table like below
Table: employee (before concatenation) | ||
id | firstname | lastname |
1 | John | Doe |
and you want your query to return like this:
Table: employee (after concatenation) | ||
id | fullname | |
1 | John Doe |
Its easy, the query is like this:
SELECT id, CONCAT(firstname, ' ', lastname) AS fullname FROM employee
If you want it to be return like for example: Firstname: John, Lastname: Doe
Try this: SELECT id, CONCAT('Firstname: ', firstname, ', Lastname: ', lastname) AS fullname FROM employee
See how to do this in VistaDB