Skip to content
Advertisement

Tag: timestamp

Split String and Count Teradata SQL

I would like to split column ‘ASPCT_VLU_NM’ and count of occurrences of the timestamps in a given time frame. For example return the ID which have more than 3 occurrence in between 1537160520286 and 1537190520286. In the example below those are the timestamps : Answer If you are using Teradata 14 or later, then you may take advantage of the

Time difference between two date fields

I have a date field names “dts” in string format. I want to find out all the records based on their time differences (in hours). The run event time should be greater than or equal to eat event. The output should be: Answer Convert timestamps to seconds, then subtract, divide result by 3600 to get hours, use case+count to count

Advertisement