Juliantimestamp Function; Examples Of Juliantimestamp; Lastnotnull Function; Example Of Lastnotnull - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

JULIANTIMESTAMP Function

The JULIANTIMESTAMP function converts a datetime value into a 64-bit Julian timestamp value
that represents the number of microseconds that have elapsed between 4713 B.C., January 1,
00:00, and the specified datetime value. JULIANTIMESTAMP returns a value of data type
LARGEINT.
JULIANTIMESTAMP is a Neoview SQL extension.
JULIANTIMESTAMP (datetime-expression)
datetime-expression
is an expression that evaluates to a value of type DATE, TIME, or TIMESTAMP. If
datetime-expression does not contain all the fields from YEAR through SECOND,
Neoview SQL extends the value before converting it to a Julian timestamp. Datetime fields
to the left of the specified datetime value are set to current date fields. Datetime fields to the
right of the specified datetime value are set to zero. See
(page
210).

Examples of JULIANTIMESTAMP

The PROJECT table consists of five columns using the data types NUMERIC, VARCHAR, DATE,
TIMESTAMP, and INTERVAL.
Convert the TIMESTAMP value into a Julian timestamp representation:
SELECT ship_timestamp, JULIANTIMESTAMP (ship_timestamp)
FROM persnl.project
WHERE projcode = 1000;
SHIP_TIMESTAMP
--------------------------
1996-04-21 08:15:00.000000
--- 1 row(s) selected.
Convert the DATE value into a Julian timestamp representation:
SELECT start_date, JULIANTIMESTAMP (start_date)
FROM persnl.project
WHERE projcode = 1000;
START_DATE
----------
1996-04-10
--- 1 row(s) selected.

LASTNOTNULL Function

The LASTNOTNULL function is a sequence function that returns the last nonnull value of a
column in an intermediate result table ordered by a SEQUENCE BY clause in a SELECT statement.
See
"SEQUENCE BY Clause" (page
LASTNOTNULL is a Neoview SQL extension.
LASTNOTNULL (column-expression)
column-expression
specifies a derived column determined by the evaluation of the column expression. If only
null values have been returned, LASTNOTNULL returns null.

Example of LASTNOTNULL

Return the last nonnull value of a column:
(EXPR)
--------------------
(EXPR)
--------------------
211695854400000000
268).
"Datetime Value Expressions"
211696834500000000
JULIANTIMESTAMP Function
347

Advertisement

Table of Contents
loading

Table of Contents