Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Query to retrieve latest version

700833Jul 16 2009 — edited Jul 16 2009
Hi,
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.
This post has been answered by Daniel W. Fink on Jul 16 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 13 2009
Added on Jul 16 2009
7 comments
1,471 views