DB2-SPUFI-Comparison Timestamp

It is very practicle question. Some times we have to do analysis searching DB2 tables and get the rows by Time stamp.

The below sql gives the way search DB2 tables:

Ex:1

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.