I'm new to working with DB2 - on the IBM AS400.
I executed the following query:
SELECT * FROM mytable WHERE ID = 1963003909
These are the query results:
ID WK END DT VRSN AMT ----------- ---------- ------ ------------ 1963003909 2012-03-24 1 0.00 1963003909 2012-03-31 1 0.00 1963003909 2012-04-07 1 0.00 1963003909 2012-04-14 1 0.00 1963003909 2012-04-21 1 0.00 1963003909 2012-04-28 1 0.00 1963003909 2012-05-05 1 0.00 1963003909 2012-05-12 1 0.00 1963003909 2012-05-19 1 0.00 1963003909 2012-05-26 1 0.00 1963003909 2012-06-02 1 0.00 1963003909 2012-06-09 1 0.00 1963003909 2012-06-16 1 0.00 1963003909 2012-06-23 1 0.00 1963003909 2012-06-30 1 0.00 1963003909 2012-07-07 1 0.00 1963003909 2012-07-14 1 0.00 1963003909 2012-07-21 1 0.00 1963003909 2012-07-28 1 0.00 1963003909 2012-07-28 2 320.00
I want to be able to modify the query, to select only the records with the maximum value in the VRSN column, in order to be able to put information in the report.
I tried to read other examples from this site, but could not find anything that did not show how to remove duplicate entries from the table.
thanks
source share