INFORMIX 时间函数大全

 

http://publib.boulder.ibm.com/infocenter/idshelp/v115/index.jsp?topic=/com.ibm.sqls.doc/ids_sqs_0187.htm

 

 

List of Expressions

Each category of SQL expression includes many individual expressions. The following table lists all the SQL expressions (and some operators) in alphabetical order. The columns in this table have the following meanings:
  • Name gives the name of each expression.
  • Description gives a short description of each expression.
  • Syntax lists the page that shows the syntax of the expression.
  • Usage shows the page that describes the usage of the expression.

Each expression listed in the following table is supported on all database servers unless otherwise noted. When an expression is not supported on all database servers, the Name column notes in parentheses the database server or servers that do support the expression.

NameDescriptionSyntaxUsage
ABS functionReturns absolute value of a numeric argumentAlgebraic FunctionsABS Function
ACOS functionReturns the arc cosine of a numeric argumentTrigonometric FunctionsACOS Function
ADD_MONTHS functionAdds a specified number of monthsTime FunctionsADD_MONTHS Function
Addition ( + ) operatorReturns the sum of two numeric operandsExpressionArithmetic Operators
ASCII functionReturns the ASCII codepoint of the first character in its string argumentString-Manipulation FunctionsASCII Function
ASIN functionReturns the arc sine of a numeric argumentTrigonometric FunctionsASIN Function
ATAN functionReturns the arc tangent of numeric argumentTrigonometric FunctionsATAN Function
ATAN2 functionComputes the angular component of the polar coordinates (r, q) associated with (x, y)Trigonometric FunctionsATAN2 Function
AVG functionReturns the mean of a set of numeric values Aggregate ExpressionsAVG Function
BITANDReturns the bitwise AND of two argumentsBitwise Logical FunctionsBITAND Function
BITANDNOTReturns the bitwise ANDNOT of two argumentsBitwise Logical FunctionsBITANDNOT Function
BITNOTReturns the bitwise NOT of two argumentsBitwise Logical FunctionsBITNOT Function
BITORReturns the bitwise OR of two argumentsBitwise Logical FunctionsBITOR Function
BITXORReturns the bitwise XOR of two argumentsBitwise Logical FunctionsBITXOR Function
CARDINALITY function (IDS)Returns the number of elements in a collection data type (SET, MULTISET, or LIST)CARDINALITY Function (IDS)CARDINALITY Function (IDS)
CASE expressionReturns a value that depends on which of several conditional tests evaluates to trueCASE ExpressionsCASE Expressions
CAST expression (IDS)Converts an expression to a specified data typeCast Expressions (IDS)Cast Expressions (IDS)
Cast ( :: ) operatorSee "Double-colon ( :: ) cast operator"Cast Expressions (IDS)Cast Expressions (IDS)
CEIL functionReturns the smallest integer that is greater than or equal to its single argumentAlgebraic FunctionsCEIL Function
CHARACTER_ LENGTH functionSee CHAR_LENGTH function. (In multibyte locales, this replaces the LENGTH function.)Length FunctionsCHAR_LENGTH Function
CHAR_LENGTH functionReturns count of logical characters in a string Length FunctionsCHAR_LENGTH Function
Column expressionComplete or partial column value from a tableColumn ExpressionsColumn Expressions
CONCAT( ) operator functionConcatenates the results of two expressionsString-Manipulation FunctionsCONCAT Function
Concatenation ( || ) operatorConcatenates the results of two expressionsExpressionConcatenation Operator
Constant expressionExpression with a literal, fixed, or variant valueConstant ExpressionsConstant Expressions
COS functionReturns the cosine of a radian expressionTrigonometric FunctionsCOS Function
COUNT (as a set of functions)Functions that return frequency counts Each form of the COUNT function is listed below.Aggregate ExpressionsOverview of COUNT Functions
COUNT (ALL column) functionSee COUNT (column) function.Aggregate ExpressionsCOUNT column Function
COUNT (column) functionReturns the number of non-NULL values in a specified columnAggregate ExpressionsCOUNT column Function
COUNT DISTINCT functionReturns the number of unique non-NULL values in a specified columnAggregate ExpressionsCOUNT DISTINCT and COUNT UNIQUE Functions
COUNT UNIQUE functionSee COUNT DISTINCT function.Aggregate ExpressionsCOUNT DISTINCT and COUNT UNIQUE Functions
COUNT (*) functionReturns the cardinality of the set of rows that satisfy a queryAggregate ExpressionsCOUNT(*) Function
CURRENT operator Returns the current time as a DATETIME value that consists of the date and the time of dayConstant ExpressionsCURRENT Operator
CURRENT_ROLE operatorReturns the currently enabled role of the user Constant ExpressionsCURRENT_ROLE Operator
sequence.CURRVAL (IDS)Returns the current value of specified sequenceConstant ExpressionsUsing CURRVAL
DATE functionConverts a nondate argument to a DATE valueTime FunctionsDATE Function
DAY functionReturns the day of the month as an integerTime FunctionsDAY Function
DBINFO (option)Functions for retrieving database and session information. Each option is listed below.DBINFO FunctionDBINFO Options
DBINFO ('bigserial')Returns most recently inserted BIGSERIAL value DBINFO FunctionUsing the 'serial8' Option and 'bigserial' Option
DBINFO ('serial8')Returns most recently inserted SERIAL8 value DBINFO FunctionUsing the 'serial8' Option and 'bigserial' Option
DBINFO ('coserverid', table. column, 'currentrow') (XPS)Returns the coserver ID of the coserver where each row of a specified table is locatedDBINFO FunctionUsing the 'coserverid' Option Followed by Table and Column Names (XPS)
DBINFO ('coserverid') (XPS)Returns the coserver ID of the coserver to which the user who entered the query is connectedDBINFO FunctionUsing the 'coserverid' Option with No Other Arguments (XPS)
DBINFO ('dbhostname')Returns the host name of the database server to which a client application is connectedDBINFO FunctionUsing the ‘dbhostname’ Option
DBINFO ('dbname')Returns the identifier of the database to which a client application is connectedDBINFO FunctionUsing the ‘dbname' Option
DBINFO ('dbspace', table.column, 'currentrow') (XPS)Returns the name of the dbspace where each row of a specified table is locatedDBINFO FunctionUsing the 'dbspace' Option Followed by Table and Column Names (XPS)
DBINFO ('dbspace', tblspace_number)Returns the name of a dbspace corresponding to a tblspace numberDBINFO FunctionUsing the ('dbspace', tblspace_num) Option
DBINFO ('get_tz' )Returns the time zone of the current sessionDBINFO FunctionUsing the 'get_tz' Option
DBINFO ('serial8')Returns most recently inserted SERIAL8 value DBINFO FunctionUsing the 'serial8' Option and 'bigserial' Option
DBINFO ('sessionid')Returns the session ID of the current sessionDBINFO FunctionUsing the 'sessionid' Option
DBINFO ('sqlca.sqlerrd1')Returns the last serial value inserted in a tableDBINFO FunctionUsing the 'sqlca.sqlerrd1' Option
DBINFO ('sqlca.sqlerrd2')Returns the number of rows processed by DML statements, and by EXECUTE PROCEDURE and EXECUTE FUNCTION statementsDBINFO FunctionUsing the 'sqlca.sqlerrd2' Option
DBINFO ('utc_current')Returns the current Coordinated Universal Time (UTC) value.DBINFO FunctionUsing the 'utc_current' Option
DBINFO ('utc_to_datetime', expression)Returns the DATETIME value of an integer or column expression that specifies a UTC value.DBINFO FunctionUsing the 'utc_to_datetime' Option
DBINFO ('version', parameter)Returns all or part, as specified by the parameter, of the exact version of the database server to which the client application is connected.DBINFO FunctionUsing the ‘version' Option
DBSERVERNAME functionReturns the name of the database serverConstant ExpressionsDBSERVERNAME and SITENAME Operators
DECODE functionEvaluates one or more expression pairs and compares the when expression in each pair with a specified value expressionDECODE FunctionDECODE Function
DECRYPT_CHAR function (IDS)Returns a plain-text string or CLOB after processing an encrypted argumentEncryption and Decryption FunctionsDECRYPT_CHAR Function
DECRYPT_ BINARY function (IDS)Returns a plain-text BLOB data value after processing an encrypted BLOB argumentEncryption and Decryption FunctionsDECRYPT_BINARY Function
DEFAULT_ROLE operator Returns the default role of the current user Constant ExpressionsDEFAULT_ROLE Operator
DELETING Boolean operatorReturns 't' if triggering event is a DELETE Trigger-Type Boolean OperatorTrigger-Type Boolean Operator
Division ( / ) operatorReturns the quotient of two numeric operandsExpressionArithmetic Operators
Double-colon ( :: ) cast operator (IDS)Converts the value of an expression to a specified data typeCast Expressions (IDS)Cast Expressions (IDS)
Double-pipe ( || ) concatenation operatorReturns a string that joins one string operand to another string operandExpressionConcatenation Operator
ENCRYPT_AES function (IDS)Returns an encrypted string or BLOB after processing a plain-text string, BLOB, or CLOBEncryption and Decryption FunctionsENCRYPT_AES Function
ENCRYPT_TDES function (IDS)Returns an encrypted string or BLOB after processing a plain-text string, BLOB, or CLOBEncryption and Decryption FunctionsENCRYPT_TDES Function
EXP functionReturns the exponent of a numeric expressionExponential and Logarithmic FunctionsEXP Function
EXTEND functionResets precision of DATETIME or DATE valueTime FunctionsEXTEND Function
FILETOBLOB function (IDS)Creates a BLOB value from data stored in a specified operating-system fileSmart-Large-Object Functions (IDS)FILETOBLOB and FILETOCLOB Functions
FILETOCLOB function (IDS)Creates a CLOB value from data stored in a specified operating-system fileSmart-Large-Object Functions (IDS)FILETOBLOB and FILETOCLOB Functions
FLOOR functionReturns the largest integer that is smaller than or equal to its single argumentAlgebraic FunctionsFLOOR Function
FORMAT_UNITS functionReturns a character string that specifies a number and the names of abbreviated units of memory or of storageFORMAT_UNITS FunctionFORMAT_UNITS Function
GETHINT function (IDS)Returns a plain-text hint string after processing an encrypted data-string argumentEncryption and Decryption FunctionsGETHINT Function
HEX functionReturns the hexadecimal encoding of a base-10 integer argumentHEX FunctionHEX Function
Host variableSee Variable.Syntax of SQL ExpressionsSyntax of SQL Expressions
INSERTING Boolean operatorReturns 't' if triggering event is an INSERT Trigger-Type Boolean OperatorTrigger-Type Boolean Operator
IFX_ALLOW_ NEWLINE functionSets a newline session mode that allows or disallows newline characters in quoted stringsIFX_ALLOW_NEWLINE FunctionIFX_ALLOW_NEWLINE Function
INITCAP functionConverts a string argument to a string in which only the initial letter of each word is uppercaseCase-Conversion FunctionsINITCAP Function
LAST_DAY functionReturns the date of the last day of the month that its argument specifiesTime FunctionsLAST_DAY Function
LENGTH functionReturns the number of bytes in a character column, not including any trailing blank spacesLength FunctionsLENGTH Function
LIST collection constructor (IDS)Constructor for collections whose elements are ordered and can contain duplicate valuesCollection ConstructorsCollection Constructors
Literal BOOLEAN Literal representation of a BOOLEAN valueConstant ExpressionsConstant Expressions
Literal collection (IDS)Represents elements in a collection data typeConstant ExpressionsLiteral Collection (IDS)
Literal DATETIME Represents a DATETIME valueConstant ExpressionsLiteral DATETIME
Literal INTERVAL Represents an INTERVAL value Constant ExpressionsLiteral INTERVAL
Literal number Represents a numeric value Constant ExpressionsLiteral Number
Literal opaque type (IDS)Represents an opaque data typeConstant ExpressionsConstant Expressions
Literal row (IDS)Represents the elements in a ROW data typeConstant ExpressionsLiteral Row (IDS)
LOCOPY function (IDS)Creates a copy of a smart large objectSmart-Large-Object Functions (IDS)LOCOPY Function
LOGN functionReturns the natural log of a numeric argumentExponential and Logarithmic FunctionsLOGN Function
LOG10 functionReturns the base-10 logarithm of an argumentExponential and Logarithmic FunctionsLOG10 Function
LOTOFILE function (IDS)Copies a BLOB or CLOB value to a fileSmart-Large-Object Functions (IDS)LOTOFILE Function
LOWER functionConverts uppercase letters to lowercaseCase-Conversion FunctionsLOWER Function
LPAD functionReturns a string that is left-padded by a specified number of pad charactersString-Manipulation FunctionsLPAD Function
LTRIM functionRemoves specified leading pad characters from a string.String-Manipulation FunctionsLTRIM Function
MAX functionReturns the largest in a specified set of valuesAggregate ExpressionsMAX Function
MDY functionReturns a DATE value from integer argumentsTime FunctionsMDY Function
MIN functionReturns the smallest in a specified set of valuesAggregate ExpressionsMIN Function
MOD function Returns the modulus (the integer-division remainder value) from two numeric argumentsAlgebraic FunctionsMOD Function
MONTH functionReturns the month value from a DATE or DATETIME argumentTime FunctionsMONTH Function
MONTHS_ BETWEEN functionReturns the difference in months between two time valuesTime FunctionsMONTHS_BETWEEN Function
Multiplication ( * ) operatorReturns the product of two numeric operandsExpressionArithmetic Operators
MULTISET collection constructor (IDS)Constructor for a non-ordered collection of elements that can contain duplicate valueCollection ConstructorsCollection Constructors
NEXT_DAY functionReturns the earliest calendar date that satisfies each of two conditionsTime FunctionsNEXT_DAY Function
sequence.NEXTVAL (IDS)Increments value of the specified sequenceConstant ExpressionsUsing NEXTVAL
NULL keywordUnknown, missing, or logically undefined valueNULL KeywordNULL Keyword
NULLIF functionReturns NULL if both arguments are equalNULLIF FunctionNULLIF Function
NVL functionReturns the value of a not-NULL argument, or a specified value if the argument is NULLNVL FunctionNVL Function
OCTET_LENGTH functionReturns the number of bytes in a character column, including any trailing blank spacesLength FunctionsOCTET_LENGTH Function
POW functionRaises a base value to a specified powerAlgebraic FunctionsPOW Function
POWER functionSynonym for POW functionAlgebraic FunctionsPOW Function
Procedure-call expressionSee user-defined function.User-Defined FunctionsUser-Defined Functions
Program variableSee variable.Syntax of SQL ExpressionsSyntax of SQL Expressions
Quoted string Literal character stringConstant ExpressionsQuoted String
RANGE functionReturns the range of a specified set of valuesAggregate ExpressionsRANGE Function
REPLACE functionReplaces specified characters in a source string String-Manipulation FunctionsREPLACE Function
ROOT functionReturns the root value of a numeric argumentAlgebraic FunctionsROOT Function
ROUND functionReturns the rounded value of an argumentAlgebraic FunctionsROUND Function
ROW constructor (IDS)Constructor for a named ROW data typeConstructor Expressions (IDS)ROW Constructors
RPAD functionReturns a string that is right-padded by a specified number of pad characters String-Manipulation FunctionsRPAD Function
RTRIM functionRemoves trailing pad characters from a stringString-Manipulation FunctionsRTRIM Function
SECLABEL_BY_ COMP functionReturns the individual components of a row security label for INSERT and UPDATE operationsSecurity Label Support Functions (IDS)SECLABEL_BY_NAME Function
SECLABEL_BY_ NAME functionReturns the identifier of a row security label for INSERT and UPDATE operationsSecurity Label Support Functions (IDS)SECLABEL_BY_COMP Function
SECLABEL_TO_ CHAR functionReturns the details of the individual components of a row security label for SELECT operationsSecurity Label Support Functions (IDS)SECLABEL_TO_CHAR Function
SELECTING Boolean operatorReturns 't' if triggering event is a SELECT Trigger-Type Boolean OperatorTrigger-Type Boolean Operator
SET collection constructor (IDS)Constructor for an unordered collection of elements in which each value is uniqueCollection ConstructorsCollection Constructors
SIN functionReturns the sine of a radian expressionTrigonometric FunctionsSIN Function
SITENAME functionSee DBSERVERNAME function.Constant ExpressionsDBSERVERNAME and SITENAME Operators
SPL routine expressionSee "User-defined functions"User-Defined FunctionsUser-Defined Functions
SPL variableSPL variable that stores an expressionSyntax of SQL ExpressionsSyntax of SQL Expressions
SQLCODE functionReturns sqlca.sqlcode value to an SPL UDRSQLCODE Function (SPL)SQLCODE Function (SPL)
SQRT functionReturns the square root of a numeric argumentAlgebraic FunctionsSQRT Function
STDEV functionReturns the standard deviation of a data setAggregate ExpressionsSTDEV Function
SUBSTR functionReturns a substring of a string argumentSUBSTR FunctionSUBSTR Function
SUBSTRING functionReturns a substring of a source stringSUBSTRING FunctionSUBSTRING Function
Substring ( [ x, y ] ) operatorReturns a substring of a string operandColumn ExpressionsUsing the Substring Operator
Subtraction ( - ) operatorReturns the difference between two numbersExpressionArithmetic Operators
SUM functionReturns the sum of a specified set of valuesAggregate ExpressionsSUM Function
SLV expression A statement-local variable (SLV) whose scope is the SQL statement that declares itStatement-Local Variable Declaration (IDS)Statement-Local Variable Expressions (IDS)
SYSDATE operatorReturns the current DATETIME value from the system clock.Constant ExpressionsSYSDATE Operator
TAN functionReturns the tangent of a radian expressionTrigonometric FunctionsTAN Function
TO_CHAR functionConverts a time or number to a stringTime FunctionsTO_CHAR Function (IDS)
TO_DATE functionConverts a string to a DATETIME valueTime FunctionsTO_DATE Function (IDS)
TO_NUMBER functionConverts two numbers or two strings to DECIMALTO_NUMBER FunctionTO_NUMBER Function
TODAY operatorReturns the current system dateConstant ExpressionsTODAY Operator
TRIM functionDrops pad characters from a string argumentString-Manipulation FunctionsTRIM Function
TRUNC functionReturns a truncated numeric or time valueAlgebraic FunctionsTRUNC Function
Unary minus ( - ) signSpecifies a negative ( < 0 ) numeric value ExpressionArithmetic Operators
Unary plus ( + ) signSpecifies a positive ( > 0 ) numeric value .ExpressionArithmetic Operators
UNITS operatorConvert an integer to an INTERVAL valueConstant ExpressionsUNITS Operator
UPDATING Boolean operatorReturns 't' if triggering event is an UPDATE Trigger-Type Boolean OperatorTrigger-Type Boolean Operator
UPPER functionConverts lowercase letters to uppercaseCase-Conversion FunctionsUPPER Function
User-defined aggregate (IDS)Aggregate that you define (as opposed to built-in aggregates that Dynamic Server provides)User-Defined Aggregates (IDS)User-Defined Aggregates (IDS)
User-defined functionFunction that you write (as opposed to built-in functions that the database server provides)User-Defined FunctionsUser-Defined Functions
USER operatorReturns the login name of the current userConstant ExpressionsUSER Operator
VariableHost or program variable that stores a valueSyntax of SQL ExpressionsSyntax of SQL Expressions
VARIANCE functionReturns the variance for a set of valuesAggregate ExpressionsVARIANCE Function
WEEKDAY functionReturns an integer code for the day of the weekTime FunctionsWEEKDAY Function
YEAR functionReturns a 4-digit integer representing a yearTime FunctionsYEAR Function
* symbolSee "Multiplication ( * ) operator"Syntax of SQL ExpressionsArithmetic Operators
+ symbolSee "Addition" and "Unary plus ( + ) sign"Syntax of SQL ExpressionsArithmetic Operators
- symbolSee "Subtraction" and "Unary minus ( - ) sign"Syntax of SQL ExpressionsArithmetic Operators
/ symbolSee "Division operator"Syntax of SQL ExpressionsArithmetic Operators
:: symbolsSee "Double-colon ( :: ) cast operator"Cast Expressions (IDS)Cast Expressions (IDS)
|| symbolSee "Double-pipe ( || ) concatenation operator"Syntax of SQL ExpressionsConcatenation Operator
[ first, last ] symbolsSee "Substring operator"Column ExpressionsUsing the Substring Operator

Sections that follow describe the syntax and usage of each expression that appears in the preceding table.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值