190 likes | 260 Views
Chapter 5 Selected Single-Row Functions. Terminology. Function – predefined block of code that accepts arguments Single-row Function – returns one row of results for each record processed Multiple-row Function – returns one result per group of data processed. Types of Functions.
E N D
Terminology • Function – predefined block of code that accepts arguments • Single-row Function – returns one row of results for each record processed • Multiple-row Function – returns one result per group of data processed
Case Conversion Functions Alter the case of data stored in a column or character string
LOWER Function Used to convert characters to lower-case letters
UPPER Function Used to convert characters to upper-case letters
INITCAP Function Used to convert characters to mixed-case
Character Manipulation Functions Manipulates data by extracting substrings, counting number of characters, replacing strings, etc.
SUBSTR Function Used to return a substring, or portion of a string
LENGTHFunction Used to determine the number of characters in a string
LTRIMandRTRIMFunctions Used to remove a specific string of characters
REPLACEFunction Substitutes a string with another specified string
CONCATFunction Used to concatenate two character strings
ROUNDFunction Used to round numeric columns to a stated precision
MONTHS_BETWEENFunction Determines the number of months between two dates
ADD_MONTHSFunction Adds a specified number of months to a date
NEXT_DAYFunction Determines the next occurrence of a specified day of the week after a given date
DECODEFunction Determines action based upon values in a list
NestingFunctions • One function is used as an argument inside another function • Must include all arguments for each function • Inner function is resolved first, then outer function