|
Archives of the TeradataForumMessage Posted: Thu, 20 Aug 2015 @ 13:03:11 GMT
Vipin, May be I took the question in wrong way but I am assuming my previous solution was very close to the answer, all we need to do is remove +1. Please check the below if this works for you, correct me If I am Wrong. SQL -------------------------- select sum(val)/ ( SELECT MIN(hh) FROM hourvalue vh WHERE NOT EXISTS ( SELECT NULL FROM hourvalue hv WHERE hv.hh = vh.hh + 1)) from hourvalue where hh < ( SELECT MIN(hh) + 1 FROM hourvalue vh WHERE NOT EXISTS ( SELECT NULL FROM hourvalue hv WHERE hv.hh = vh.hh + 1)) -------------------------- Thanks, Sandeep. GANGA SANDEEP KUMAR
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||