|
Archives of the TeradataForumMessage Posted: Thu, 20 Aug 2015 @ 12:27:24 GMT
Hi Tom, Thanks for your suggestion. However, your query is returning cumulative avg for every row and my requirement is to return the "avg of all values" and "number of hours" used for which col_hour data is in sequence. Consider following data for reference: col_hour col_value 1 10 2 20 3 30 4 40 6 50 7 60 8 70 9 80 10 90 11 100 12 110 Since col_hour is breaking after 4th hour, Output of the query should be: Avg NoOfHrsUsed --- ----------- 25 4 Another sample: col_hour col_value 1 10 2 20 3 30 4 40 5 50 7 60 8 70 9 80 10 90 11 100 12 110 Since col_hour is breaking after 5th hour, Output of the query should be: Avg NoOfHrsUsed --- ----------- 30 5 Thanks, Vipin
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||