Franco Bruno Borghesi (franco) writes: > If I understand well, you want the highest cmup for each partno, that is > max(cmup) grouped by partno (only). > > SELECT T.partno, T.status, TMP.max_cmup_for_partno, max(T.cmup) AS > max_cmup, sum(T.qty) AS sum_qty > FROM my_table T, (SELECT partno, max(cmup) AS max_cmup_for_partno FROM > my_table GROUP BY partno) AS TMP > WHERE tmp.partno=T.partno > GROUP BY T.partno, TMP.max_cmup_for_partno, T.status > > Hope it helped.
This worked out nicely. Thank you very much ! /mich
pgp9ccTsZYXoJ.pgp
Description: PGP signature