私は次のデータを持っています:
Product Price StartDate EndDate
Apples 4.9 2010-03-01 00:00:00.000 2010-03-01 00:00:00.000
Apples 4.9 2010-03-02 00:00:00.000 2010-03-02 00:00:00.000
Apples 2.5 2010-03-03 00:00:00.000 2010-03-03 00:00:00.000
Apples 4.9 2010-03-05 00:00:00.000 2010-03-05 00:00:00.000
Apples 4.9 2010-03-06 00:00:00.000 2010-03-06 00:00:00.000
Apples 4.9 2010-03-09 00:00:00.000 2010-03-09 00:00:00.000
Apples 2.5 2010-03-10 00:00:00.000 2010-03-10 00:00:00.000
Apples 4.9 2010-03-11 00:00:00.000 2010-03-11 00:00:00.000
Apples 4.9 2010-03-12 00:00:00.000 2010-03-12 00:00:00.000
Apples 4.9 2010-03-13 00:00:00.000 2010-03-13 00:00:00.000
Apples 4.9 2010-03-15 00:00:00.000 2010-03-15 00:00:00.000
Apples 4.9 2010-03-16 00:00:00.000 2010-03-16 00:00:00.000
のようにグループ化したいproduct, price, min(startdate), max(startdate)
が、開始日と終了日にもグループ化する必要があります........以下のようなもの
望ましい結果
Apples 4.9 2010-03-01 00:00:00.000 2010-03-02 00:00:00.000
Apples 2.5 2010-03-03 00:00:00.000 2010-03-03 00:00:00.000
Apples 4.9 2010-03-05 00:00:00.000 2010-03-09 00:00:00.000
Apples 2.5 2010-03-10 00:00:00.000 2010-03-10 00:00:00.000
Apples 4.9 2010-03-11 00:00:00.000 2010-03-16 00:00:00.000