Examples Of Interval Literals; Numeric Literals - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

Examples of Interval Literals

INTERVAL '1' MONTH
INTERVAL '7' DAY
INTERVAL '2-7' YEAR TO MONTH
INTERVAL '5:2:15:36.33' DAY TO SECOND(2)
INTERVAL - '5' DAY
INTERVAL '100' DAY(3)
INTERVAL '364 23' DAY(3) TO HOUR

Numeric Literals

A numeric literal represents a numeric value. Numeric literals can be represented as an exact
numeric literal (without an exponent) or as an approximate numeric literal by using scientific
notation (with an exponent).
exact-numeric-literal is:
[+|-]unsigned-integer[.[unsigned-integer]]
| [+|-].unsigned-integer
approximate-numeric-literal is:
mantissa{E|e}exponent
mantissa is:
exact-numeric-literal
exponent is:
[+|-]unsigned-integer
unsigned-integer is:
digit...
exact-numeric-literal
is an exact numeric value that includes an optional plus sign (+) or minus sign (-), up to 18
digits (0 through 9), and an optional period (.) that indicates a decimal point. Leading zeros
do not count toward the 18-digit limit; trailing zeros do.
A numeric literal without a sign is a positive number. An exact numeric literal that does not
include a decimal point is an integer. Every exact numeric literal has the data type NUMERIC
and the minimum precision required to represent its value.
approximate-numeric-literal
is an exact numeric literal followed by an exponent expressed as an uppercase E or lowercase
e followed by an optionally signed integer.
Numeric values expressed in scientific notation are treated as data type REAL if they include
no more than seven digits before the exponent, but treated as type DOUBLE PRECISION if
they include eight or more digits. Because of this factor, trailing zeros after a decimal can
sometimes increase the precision of a numeric literal used as a DOUBLE PRECISION value.
For example, if XYZ is a table that consists of one DOUBLE PRECISION column, the inserted
value:
INSERT INTO XYZ VALUES (1.00000000E-10)
has more precision than:
INSERT INTO XYZ VALUES (1.0E-10)
228
SQL Language Elements
Interval of 1 month
Interval of 7 days
Interval of 2 years, 7 months
Interval of 5 days, 2 hours, 15 minutes, and 36.33 seconds
Interval that subtracts 5 days
Interval of 100 days. This example requires an explicit
leading precision of 3 because the default is 2.
Interval of 364 days, 23 hours. The separator for the day
and hour fields can be a space or a colon.

Advertisement

Table of Contents
loading

Table of Contents