If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
with t1 (s,v,n) as
(select x.cols,x.colv,t.coln from x inner join y on (x.colv = y.colv)),
t2 (s,n) as
(select s,max(n) from t1 group by s)
select * from t1 where (s,n) in (select * from t2)