SPUFI Query way to get rows based on TimeStamp

It is very practical question. Some times you need do analysis in searching DB2 tables and get the rows by Time stamp.

The below SQL gives the way search DB2 tables:

Example:

SELECT A, B, C

FROM SAMP_TBL
WHERE
A >=  ‘1999-01-01 00:00:00.000000’
or…

A <=  ‘1999-01-01 00:00:00.000000’

or…

A = Current Timestamp – 90 days

or…

A = ‘1999-01-01 00:00:00.000000’  + 30 days

etc…

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.