Archives of the TeradataForum
Message Posted: Sat, 24 Aug 2001 @ 18:11:49 GMT
You have receive some very good CAST techniques to work around your problem. However, be aware that converting data is slow and converting converted data (CAST within a CAST) is very slow over millions of rows.
I have seen SQL generated out of Business Objects that uses this techique. It contained 2 of these. When we did date math instead, the run time went from 1 hour to 4 minutes and 47 seconds - a considerable savings.
If you are using these for comparison purposes, I would first try a correlated subquery, something like this:
WHERE < date-col > =(SELECT MAX(< date-col >) FROM < table > WHERE < domain-col-t1 > = < domain-col-t2 >) AND < time-col > =(SELECT MAX(< time-col >) FROM < table > WHERE < domain-col-t1 > = < domain-col-t2 >)
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|