LTRIM and RTRIM Functions in SQL || Lesson 58 || DBMS || Learning Monkey ||

preview_player
Показать описание
LTRIM and RTRIM Functions in SQL

In this class, we will understand LTRIM and RTRIM Functions in SQL.

We have already discussed the concepts of LPAD and PAD functions.

LTRIM and RTRIM Functions in SQL

LTRIM and RTRIM will trim off the unwanted character from the left or right ends of the strings.
LTRIM and RTRIM Syntax

LTRIM(String, [‘set’]);

LTRIM is the name of the function.

The string is the name of the column, or it can be just the string.

Set will be provided with characters that are to be trimmed.

RTRIM(String, [‘set’]);

RTRIM is the name of the function.

The string is the name of the column, or it can be just the string.

Set will be provided with characters that are to be trimmed.
Examples of LTIM and RTRIM

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

The below are the queries and the outputs with the use of LTRIM and RTRIM.

SELECT LTRIM(name, ‘”‘) FROM students;

SELECT RTRIM(name, ‘.”‘) FROM students;

SELECT LTRIM(RTRIM(name, ‘.”‘), ‘”‘) FROM students;

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

Link for playlists:

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

I don't see how this command is useful

arizansari
join shbcf.ru