I am working with DB2 and its feature "Temporal logic" (if you are interesting in the topic - https://www.ibm.com/developerworks/data/library/techarticle/dm-1204db2temporaldata/index.html gives an introduction). I got one question about an issue which I cannot understand so far:
This example will work perfectly fine:
SELECT * FROM policy
FOR BUSINESS_TIME FROM '2009-01-01' TO '2011-01-01'
But if I want to join more tables, I get errors that the syntax is wrong. And there are no examples (read: I cannot find examples) of how to do it.
Yes, I know how to avoid this "feature", and make it work with sub select. And even between date_from
and date_to
won't help here. Because this BUSINESS_TIME
is not equal date_to
.
In my case, something like:
where'2009-01-01' <='2009-01-01'<'2011-01-01'
doesn't work.
Update in DB2 should be like this:
where '2009-01-01'<='2009-01-01'
and '2009-01-01'<'2011-01-01'
Thanks a lot in advance!
Joining also works - this is one of my examples joining two tables on BUSINESS TIME
I hope you find this helpful for your scenario.