CONCAT in SQL || Lesson 55 || DBMS || Learning Monkey ||

preview_player
Показать описание
CONCAT in SQL

In this class, we will understand CONCAT in SQL.

We have already discussed the concept of many logical operators.

Getting Text and Changing it

From this class, we will understand “Getting Text and Changing it” operators.

SQL provides a variety of features to perform operations on the text obtained as the query’s output.

We can display the output of the query in different ways.
CONCAT in SQL

In this class, we will understand one of the methods, CONCAT.

CONCAT or ||: Concatenates two strings together.

To understand this, we will consider the table as shown below.

Let us try to CONCATENATE the column’s name and id in the query’s output as shown below.

SELECT name||id FROM students;

In the above query, we are concatenating the values in the name and id columns.

The output of the query is as shown below.

In the above output, the values are combined and look very clumsy.

We can use separators with the CONCAT.
CONCAT with separators

The query with separators is as shown below.

SELECT name||’-‘||id FROM students;

The output of the query is as shown below.

Now the output looks clear.

#learningmonkey #dbms #placements #gatecse #gatedbms #campusplacements

Link for playlists:

Рекомендации по теме
Комментарии
Автор

Sir I'm not able to concatenate using || .concat() function is working to concat what we need.

srinidhi
visit shbcf.ru