469628006 by Unknown
Author:Unknown
Language: eng
Format: epub
Figure 5.2
Letâs demonstrate another function:
SELECT description, Upper(description) FROM film;
Run this query; the output will have the description column and the uppercase of that column.
We can even use it with strings as follows:
Figure 5.3
The Character Manipulation Functions
The character manipulation functions can be used to manipulate character strings. There are many such functions, and we will have demonstrations of them one by one in this section. We can use strings or character columns with these functions.
We can concatenate two strings with the function It works in the same way as the operator Both the arguments to the call of this function are stings. Following are the examples of the same:
SELECT CONCAT('Oracle', ' SQL') FROM DUAL;
SELECT CONCAT(title, description) FROM film;
In the first example, we are concatenating two strings, and in the second example, we are concatenating two different character columns. This is one of the simplest character manipulation functions.
We can extract a substring from a string with the function as follows:
SELECT SUBSTR('Oracle SQL', 1, 6) FROM DUAL;
The indexing of the strings starts from 1. The first argument is the string or the column from which we need to extract the substring. The second and third arguments are starting and ending indices of the substring from the string. The query above will output the string
We can use the function to determine the length of a string or a character column as follows:
SELECT title, LENGTH(title) FROM film;
We can know the location of a substring within a string using the function as follows:
SELECT INSTR('Oracle SQL', 'S') FROM DUAL;
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Twisted Games: A Forbidden Royal Bodyguard Romance by Ana Huang(3675)
Den of Vipers by K.A Knight(2570)
The Push by Ashley Audrain(2565)
Win by Harlan Coben(2515)
Echo by Seven Rue(2140)
Beautiful World, Where Are You: A Novel by Sally Rooney(2041)
Leave the World Behind by Rumaan Alam(1985)
Iron Widow by Xiran Jay Zhao(1972)
Baby Bird by Seven Rue(1944)
Midnight Mass by Sierra Simone(1901)
A Little Life: A Novel by Hanya Yanagihara(1754)
Undercover Threat by Sharon Dunn(1680)
The Four Winds by Hannah Kristin(1672)
Bridgertons 2.5: The Viscount Who Loved Me [Epilogue] by Julia Quinn(1670)
The Warrior's Princess Prize by Carol Townend(1546)
Sister Fidelma 07 - The Monk Who Vanished by Peter Tremayne(1498)
Snowflakes by Ruth Ware(1485)
Dark Deception by Rina Kent(1432)
Facing the Mountain by Daniel James Brown(1430)
