SQL Reference

HOUR

>>-HOUR---(--expression--)-------------------------------------><
 

The schema is SYSIBM.

The HOUR function returns the hour part of a value.

The argument must be a time, timestamp, time duration, timestamp duration or a valid character string representation of a time or timestamp that is neither a CLOB nor a LONG VARCHAR.

The result of the function is a large integer. If the argument can be null, the result can be null; if the argument is null, the result is the null value.

The other rules depend on the data type of the argument:

Example:

Using the CL_SCHED sample table, select all the classes that start in the afternoon.

  SELECT * FROM CL_SCHED
    WHERE HOUR(STARTING) BETWEEN 12 AND 17


[ Top of Page | Previous Page | Next Page ]