From the course: Oracle Database 12c: Basic SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using SUBSTRING, LENGTH, and CONCAT

Using SUBSTRING, LENGTH, and CONCAT - Oracle Database Tutorial

From the course: Oracle Database 12c: Basic SQL

Start my 1-month free trial

Using SUBSTRING, LENGTH, and CONCAT

- [Instructor] Substring, or SUBSTR as it's known in Oracle dialect, allows us to truncate the length of string values, that is varchar data types, when we select data from our tables. Let's see it in action. We'll start by selecting all columns from our jobs table. Let's divert our attention specifically to the job title column. As you can see, this column contains string values, or varchar values, of variable lengths. So President is shorter than Administration Vice President. Using SUBSTR we can restrict or truncate the length of strings returned from our tables. So for example, I can type substr, that's the function name, bracket, provide the column name on which I want to apply the function, that is job_title, comma, and then provide a starting position for the function, say the first character, comma, and a length. Say five characters. And I can close the function using another bracket. By using SUBSTR specifying the job title column, the starting position of one, and the length…

Contents