SQL Value Functions

You use SQL value expressions to combine two or more values. Several kinds of SQL value expressions exist, corresponding to the different data types; the following tables list string, numeric, and datetime values, functions, and effects:

































String Value Functions
FunctionEffect
SUBSTRINGExtracts a substring from a source string
UPPERConverts a character string to all uppercase
LOWERConverts a character string to all lowercase
TRIMTrims off leading or trailing blanks
TRANSLATETransforms a source string from one character set to
another
CONVERTSame as TRANSLATE. (It transforms a source string from one
character set to another.)
























Numeric Value Functions
FunctionEffect
POSITIONReturns the starting position of a target string within a
source string
CHARACTER_LENGTHReturns the number of characters in a string
OCTET_LENGTHReturns the number of octets (bytes) in a character string
EXTRACTExtracts a single field from a datetime or interval




















Datetime Value Functions
FunctionEffect
CURRENT_DATEReturns the current date
CURRENT_TIME(p)Returns the current time; (p) is precision of seconds
CURRENT_TIMESTAMP(p)Returns the current date and the current time; (p) is precision
of seconds








dummies

Source:http://www.dummies.com/how-to/content/sql-value-functions.html

No comments:

Post a Comment