Query to retrieve latest version
700833Jul 16 2009 — edited Jul 16 2009Hi,
I am trying to create a query that retreives the latetst version of a product. There are 2 tables I query from, one has the product number and one has the version- a varchar2(60) datatype. The versions are listed A,B,C..... etc. So I want the query to give me one row for each product with its latest version. This is the query I have thus far,
SELECT A0.Prod_num, A0.version
FROM (SELECT A0B.Prod_num, A0.version
FROM tb_1 A0,tb_2 A0B
WHERE (A0.tb_1pk=A0B.tb_2pk)) A0
order by A0.Prod_num
This returns duplicate rows of products and versions.
Thanks.