Teradata Sql to find the nbr of transactions in an interval of 15 minutes to group the data

Teradata Applications
Visitor

Teradata Sql to find the nbr of transactions in an interval of 15 minutes to group the data

Hello All,

 

I am new to this Forum and i am struggling on google to find out the teradata query to find the nbr of transactions in an interval of 15 Minutes.

Here is the data that i would be needing.

 

Date                                  Nbr of Transactions
08/27/2017 11:00:00         1
08/27/2017 11:15:00         2
08/27/2017 11:30:00         3
08/27/2017 11:45:00         1
08/27/2017 12:00:00         2

How can i do it.Please provide me your input.

Thanks !!!

2 REPLIES
Junior Contributor

Re: Teradata Sql to find the nbr of transactions in an interval of 15 minutes to group the data

Based on your example result you want to truncate an existing timestamp column to quarters:

tscol - (Extract(SECOND From tscol) * INTERVAL '1' SECOND)
      - (Extract(MINUTE From tscol) MOD 15) * INTERVAL '1' MINUTE

and then GROUP BY it

Re: Teradata Sql to find the nbr of transactions in an interval of 15 minutes to group the data

Dnoeth,

 

I need to ask you a Teradata SQL question, how do I send it to you specifically ?

Is there an email for you ?