You could try this ...
1 select D.title, D.doc_num, D.version from junk D,
4 A.doc_num doc_num
5 , MAX(A.version) version
7 junk A
8 , junk B
10 A.doc_num = B.doc_num
11 and A.title = B.title
12 and A.version >= B.version
13 group by
15 ) C
16* where D.doc_num = C.doc_num and D.version = C.version
... bleh what a ugly mess.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||