SECOND Function

Returns the second from a time or datetime value.

Category: Date and Time
Returned data type: DOUBLE

Syntax

SECOND(time | datetime)

Arguments

time

specifies any valid expression that represents a time value.

Data type TIME
See <sql-expression>
FedSQL Expressions

datetime

specifies any valid expression that represents a datetime value.

Data type TIMESTAMP
See <sql-expression>
FedSQL Expressions

Details

In Hive, when the SECOND function is used to search for a specific value, the function will fail if there is more than one column of type TIME in the table.

Example

The following statement illustrates the SECOND function:
Statements
Results
select second(endtime) from custonline;
 1.253
 9.421
55.746
 9.398
45.221
15.766
56.288
33.955
27.908
20.475