Improving query performance

Database

Improving query performance

Hi,

Is there any query to pad a zero only if the hour/ min is single digit? Otherwise display as it is. I am able to do this using substring and trim, but the query is taking too long. Is the any easy way for this? I am having approximately 24 M records. Any help  is appreciated.

Thanks.

2 REPLIES
Junior Contributor

Re: Improving query performance

Assuming this is for a date/time column you can use a regex, there was a similar thread:

http://forums.teradata.com/forum/enterprise/convert-varchar-to-timestamp#comment-147303

Enthusiast

Re: Improving query performance

hI,

Just wanted to compare 

CAST and TO_NUMBER. Which one performs betteR?