I shoulnt have to ask this but my mind just doesnt want to give me an answer tonight. I have this data
a b c
94070 9764 scacggwla
94070 26840 rmansdick
179741 16207 schedgllu
179741 28738 scherellu
221280 0 bbmigwels
what I need returened is
94070 26840 rmansdick
179741 28738 scherellu
221280 0 bbmigwels
select
distinct(1), c
from
table
where a in (select a from table1)
group by c
having b = max(b)
Now the problem is that the distinct(a) can not pull a distinct since other columns in the select are different. I am totally out of ideas and am frankly embarrised about it. Any help?
a b c
94070 9764 scacggwla
94070 26840 rmansdick
179741 16207 schedgllu
179741 28738 scherellu
221280 0 bbmigwels
what I need returened is
94070 26840 rmansdick
179741 28738 scherellu
221280 0 bbmigwels
select
distinct(1), c
from
table
where a in (select a from table1)
group by c
having b = max(b)
Now the problem is that the distinct(a) can not pull a distinct since other columns in the select are different. I am totally out of ideas and am frankly embarrised about it. Any help?