sql - Select all from a table, where 2 columns are Distinct -


hi have table of deals, need return entire table need title , price distinct, there quite few double ups, i've put in example scenario below

col id || col title || col price || col source b c d b c b b a c b a 1 

expected result:

a b c d b a c 

i'm not sure whether or not use distinct or group here, suggestions appreciated

cheers

scott

=======================

looking @ of suggestions i'm going have rethink this, guys

this arbitrarily pick 1 of rows each distinct (price,title) pair

;with mycte (     select        *,        rownumber() on (partition price, title order source) rn            mytable )  select     *     mycte     rn = 1 

Comments