tsql - SQL: Retrieve Values if different from prior date -
i have following table:
date_ value_ 2013-07-13 100055 2013-07-14 100055 2013-07-15 120060 2013-07-16 115040 2013-07-17 115040 2013-07-18 130005
i return first value in results , every change.
desired output:
date_ value_ 2013-07-13 100055 2013-07-15 120060 2013-07-16 115040 2013-07-18 130005
thanks help!
you looking group by
clause , min
function
select min(date_) date_, value_ tab group value_
Comments
Post a Comment