From: Jeff Chamard Date: October 19 2000 6:17pm Subject: Help needed... List-Archive: http://lists.mysql.com/internals/36 Message-Id: <004f01c039f8$e98739c0$3800a8c0@lepc> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_004C_01C039D7.61D6E8C0" ------=_NextPart_000_004C_01C039D7.61D6E8C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I need your help plz. - I have 2 tables. "Invcom09" and "itemdyn". - The key is "noitem" (I mean I use this field for my query but I don'r = have a key, it doesn't matter for this query). - There can be more than one order for the same noitem. This mean I have = more than one row for each noitem. What I need to get is the row for the ultimate date FOR EACH ITEM (sorry = for the caps...). Here's my query: select itemdyn.noitem, max(datecomm), price; from invcom09,itemdyn; where itemdyn.noitem =3D invcom09.noitem; and itemdyn.noitem between "DY-98-02" and "DY-98-06" group by 1 As You can see. this is only as an example. What I get is the ultinate date for each item (this is Great!) BUT I = don't get the right price that match with my ultimate date. I hope you'll be able to help me, Thanks Jeff ------=_NextPart_000_004C_01C039D7.61D6E8C0--