Posted: Tue Feb 06, 2007 10:20 am Post subject: timestamp - 1 minute
Code:
SELECT * FROM TABLE WHERE TSP <= :WS-TSP AND TSP >= :WS-TSP - 1 MINUTES;
during execution, does the subtraction of 1 minute calculate to the exact millisecond? .. Or are the seconds and milliseconds part (from WS-TSP) ignored?!?
Further, what happens if it were 1 SECONDS instead of a minute? _________________ If our constitution allows us free speech, why are there phone bills?
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Tue Feb 06, 2007 11:26 am Post subject:
blitz2, isn't 1 minute equal to 0 years, 0 months, 0 days, 0 hours, 1 min, 0 sec, 0 mil? If it where 1 seconds, there would be 0 years, etc... I think DB2 would generate the required literal so that the timestamp reduction (- 1 min) could be done and use a somewhat general compare routine for timestamps, all 26 characters; I believe nothing is ignored
the proof of 'exactness of the millisecond' is borne by the timestamps contained in the table. all you are doing with your SQL is accessing rows within a range of timestamps - something that DB2 does do with exactness. _________________ Dick Brenholtz
American living in Varel, Germany
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum