You are on page 1of 1

select a.productid,max(a.cost)as cost,max(a.

for_date) as date_purchased from q2


as a
inner join
(
select productid,for_date from q2
)as b
on a.productid=b.productid
inner join q1
on q1.productid=a.productid
group by a.productid

You might also like