Home Forums SQL Server 2008 T-SQL (SS2K8) find a grouping with at least one row within the group containing a certain value RE: find a grouping with at least one row within the group containing a certain value

  • --Check this

    SELECT Name,TYPE,Price FROM

    (SELECT Name, [TYPE], Price

    ,ROW_NUMBER() OVER (PARTITION BY NAME ORDER BY PRICE DESC) AS N FROM @t) AS A

    WHERE N=1