this is how you will get data you need on database. if you have any questions just ask ;)
begin tran
drop table #table2
create table #table2(
sku varchar(20),
avail int,
price int
)
insert into #table2 values('a', 1, 18)
insert into #table2 values('b', 1, 20)
insert into #table2 values('c', 1, 15)
insert into #table2 values('d', 0, 25)
insert into #table2 values('a', 20, 13)
insert into #table2 values('a', 8, 9)
insert into #table2 values('a', 9, 17)
insert into #table2 values('b', 0, 25)
select * from #table2
select sku, min(price) from #table2 where avail >= 1
group by sku
select grouped.sku, t.avail, grouped.price from #table2 t
left join (
select sku, min(price) as price from #table2 where avail >= 1
group by sku
) as grouped
on t.sku = grouped.sku and t.price = grouped.price
where grouped.sku is not null
rollback tran