Archives of the TeradataForum
Message Posted: Wed, 20 Jan 2010 @ 14:51:42 GMT
| Subj: || || Re: Workaround to avoid product join |
| From: || || Geoffrey Rommel |
Teradata does product joins pretty well. Perhaps, instead of separate minute and second fields, the start and end times should be stored as
seconds since midnight (0-86399). This will make the calculations easier.
If it is too late to change the physical tables, you could calculate those values in a derived table. Instead of "FROM Table A A", use
something like this:
(select MINUTE_STARTING, MINUTE_ENDING, SEC_FIRST_MIN,
(MINUTE_STARTING * 60) + SEC_FIRST_MIN as LOGON_SEC,
(MINUTE_ENDING * 60) + SEC_LAST_MIN as LOGOFF_SEC, ...
from TableA) A
Hope this helps....