Concatenation

Are you new to the eduTrac SIS online user's manual? If so, click here for a starting point. If you are looking for technical documentation, then check out the Wiki.

 

A concatenation is the combining of two or more columns, expressions, or literal strings to display combined data in one column. The MySQL function for concatenation is CONCAT. For example:

CONCAT( expression_1, ‘ ‘, expression_2 ) where expression_1 and expression_2 are either column names, expressions, or literal strings separated by a delimiter. In this case, it is a space.

 A literal string is a set of characters, numbers, or a date that is not a column name. Any string of text serves as a literal string MUST be enclosed in SINGLE quotes. The literal displays for each row that the query returns. Numeric literals do not have to be in quotes.
SELECT CONCAT(fname,' ',lname) AS 'Name' FROM person;

The values from the fname and lname columns display together in one column of output with ‘Name’ as a column heading which is the literal string.

[table “” not found /]
 This is the end of the third section in this series. Feel free to take the quiz to try out your knowledge. 

Last Modified: Jul 22, 2015 @ 5:34 PM

Was this article helpful?

Related Articles