Remove Duplicate as long as start date is the same
===

I have a table

    CREATE TABLE ProductPrice
    (
    ProductId       INT             NOT NULL,
    EffectiveDt     DATE            NOT NULL,
    InactiveDt      DATE            NOT NULL,
    Price           DECIMAL(10,2)   NOT NULL
    )

and i have some test data

    DECLARE @BaseDate DATE;

    SET @BaseDate = GETDATE();

    INSERT INTO ProductPrice
    (
    ProductId,
    EffectiveDt,
    InactiveDt,
    Price
    )
          SELECT 1 , @BaseDate                   , DATEADD(DAY, 10, @BaseDate), 1.00
    UNION SELECT 1 , DATEADD(DAY, 13, @BaseDate) , DATEADD(DAY, 18, @BaseDate), 1.00

    UNION SELECT 2 , @BaseDate                   , DATEADD(DAY, 10, @BaseDate), 1.00
    UNION SELECT 2 , DATEADD(DAY, 22, @BaseDate) , DATEADD(DAY, 28, @BaseDate), 1.00

    UNION SELECT 3 , @BaseDate                   , DATEADD(DAY, 10, @BaseDate), 1.00
    UNION SELECT 3 , DATEADD(DAY, 08, @BaseDate) , DATEADD(DAY, 24, @BaseDate), 1.00
    UNION SELECT 3 , DATEADD(DAY, 22, @BaseDate) , DATEADD(DAY, 28, @BaseDate), 1.00

    UNION SELECT 4 , @BaseDate                   , DATEADD(DAY, 10, @BaseDate), 1.00
    UNION SELECT 4 , DATEADD(DAY, 07, @BaseDate) , DATEADD(DAY, 15, @BaseDate), 1.00

    UNION SELECT 5 , @BaseDate                   , DATEADD(DAY, 10, @BaseDate), 1.00
    UNION SELECT 5 , DATEADD(DAY, 11, @BaseDate) , DATEADD(DAY, 15, @BaseDate), 1.00

    UNION SELECT 6 , @BaseDate                   , DATEADD(DAY, 10, @BaseDate), 1.00
    UNION SELECT 6 , DATEADD(DAY, 09, @BaseDate) , DATEADD(DAY, 20, @BaseDate), 1.00
    UNION SELECT 6 , DATEADD(DAY, 12, @BaseDate) , DATEADD(DAY, 20, @BaseDate), 1.00

    UNION SELECT 7 , @BaseDate                   , DATEADD(DAY, 19, @BaseDate), 1.00
    UNION SELECT 7 , DATEADD(DAY, 15, @BaseDate) , DATEADD(DAY, 25, @BaseDate), 1.00
    UNION SELECT 7 , DATEADD(DAY, 20, @BaseDate) , DATEADD(DAY, 32, @BaseDate), 1.00

    UNION SELECT 8 , @BaseDate                   , DATEADD(DAY, 10, @BaseDate), 1.00
    UNION SELECT 8 , @BaseDate                   , DATEADD(DAY, 14, @BaseDate), 1.00

    UNION SELECT 9 , @BaseDate                   , DATEADD(DAY, 05, @BaseDate), 1.00
    UNION SELECT 9 , @BaseDate                   , DATEADD(DAY, 10, @BaseDate), 1.00
    UNION SELECT 9 , @BaseDate                   , DATEADD(DAY, 15, @BaseDate), 1.00
    UNION SELECT 9 , @BaseDate                   , DATEADD(DAY, 20, @BaseDate), 1.00

    UNION SELECT 10, @BaseDate                   , DATEADD(DAY, 10, @BaseDate), 1.00
    UNION SELECT 10, @BaseDate                   , DATEADD(DAY, 15, @BaseDate), 1.00
    UNION SELECT 10, @BaseDate                   , DATEADD(DAY, 15, @BaseDate), 1.00

    UNION SELECT 11, @BaseDate                   , DATEADD(DAY, 10, @BaseDate), 1.00
    UNION SELECT 11, DATEADD(DAY, 07, @BaseDate) , DATEADD(DAY, 25, @BaseDate), 1.00
    UNION SELECT 11, DATEADD(DAY, 07, @BaseDate) , DATEADD(DAY, 27, @BaseDate), 1.00
    UNION SELECT 11, DATEADD(DAY, 20, @BaseDate) , DATEADD(DAY, 32, @BaseDate), 1.00

    UNION SELECT 12, @BaseDate                   , DATEADD(DAY, 15, @BaseDate), 1.00
    UNION SELECT 12, DATEADD(DAY, 16, @BaseDate) , DATEADD(DAY, 10, @BaseDate), 1.00

what i'm wanting is that if a ProductId has more than one record that start on the same date that it deletes all the duplicates apart from the longest one. so one records form product 8, three from product 9, two from product 10 and then 1 from product 11 but as you can see product 11's duplicates had the same start date but it is not the earliest date.

currently i have

    DELETE de
    FROM
        ProductPrice de
    INNER JOIN
        ProductPrice ex
    ON
        ex.ProductId   = de.ProductId
    AND ex.EffectiveDt = de.EffectiveDt
    AND ex.InactiveDt  > de.InactiveDt

but that only gets rid of duplicates if the are the earliest start dates

any help would be very appricated