Download Database - National Instruments

Transcript
Appendix A
SQL Language Reference
SQL Functions
Table A-5 lists the functions you can use in SQL statements.
Table A-5. SQL Functions
Function
Description
ROUND(num_expr1,
num_expr2)
num_expr1 rounded to num_expr2 decimal places.
CHR(num_expr)
Character having ASCII value num_expr.
LOWER(char_expr)
Change all characters in char_expr to lower case.
LTRIM(char_expr)
Strip leading spaces from char_expr.
LEFT(char_expr)
Leftmost character of char_expr.
RIGHT(char_expr)
Rightmost character of char_expr.
SPACE(num_expr)
Construct a string with num_expr blanks.
IFF(logical_expr,
True_Value, False_Value)
Return True_Value if logical_expr is true otherwise
return False_Value.
STR(num_expr, width [prec])
Converts num_expr to string of width characters with
optional prec fractional digits.
STRVAL(expr)
Converts any expr to a character string.
TIME()
Returns time of day as a character string.
LEN(char_expr)
Number of characters in char_expr.
AVG(column_name)
(must be numeric column)
Average of all non-null values in column_name.
COUNT(*)
Number of rows in table.
MAX(col_expr)
Maximum value of col_expr.
MAX(num_expr1, num_expr2)
Maximum of num_expr1 and num_expr2.
MIN(num_expr1, num_expr2)
Minimum of num_expr1 and num_expr2.
SUM(col_expr)
Sum of values in col_expr.
LabWindows/CVI SQL Toolkit Reference Manual
A-6
© National Instruments Corporation