max row perday

  • Can you help me to find one row per day ?      

    1        A         03/07/07       13

    1        B          03/07/07      12

    1         C         03/07/07       11

    2         AB        11/07/07       10

    2        QC         11/07/07       9

     

    with result

    1        A         03/07/07       13

    2         AB        11/07/07       10

     

  • SELECT Main.* FROM dbo.Table Main INNER JOIN (SELECT DateCol, Max(Qty) AS mQty FROM dbo.Table GROUP BY DateCol) dtMRD ON Main.DateCol = dtMRD.DateCol AND Main.Qty = dtMRD.mQty

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply