From: John James Rambo Date: February 21 2012 11:59pm Subject: Re: Inner Join Question List-Archive: http://lists.mysql.com/php/215 Message-Id: <1329868757.6332.7.camel@jjrambo-office> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=-iWALlNK8IFiGqXQwreYx" --=-iWALlNK8IFiGqXQwreYx Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Not sure I have the whole picture. Without thinking it all the way through I can suggest if your comments are dated, replace "comment_date" with whatever you call your field and try the following: (NOTE THE LEFT JOIN TOO) SELECT `customer`.`name`, `comments`.`note`, MAX(comment_date) FROM customer LEFT JOIN `comments` ON `customer`.`id` =3D `comments`.`customer` WHERE `customer`.`join_date` >=3D "2012-01-01 00:00:00" ORDER BY `customer`.`join_date` ASC Gotta run! JR On Tue, 2012-02-21 at 18:00 -0500, admin wrote: > I have an issue where I am joining a table on a table. >=20 > The problem is the table I am joining has more than one row of matching > data. >=20 > =20 >=20 >=20 >=20 > SELECT `customer`.`name`, `comments`.`note` FROM customer >=20 > INNER JOIN `comments` ON `customer`.`id` =3D `comments`.`customer` >=20 > WHERE=20 >=20 > `customer`.`join_date` >=3D "2012-01-01 00:00:00" >=20 > ORDER BY `customer`.`join_date` >=20 > ASC >=20 > =20 >=20 >=20 >=20 > I need to return all the customers and the last note for each customer >=20 > But what I get is a list with the repeat of each customer for each note. >=20 > =20 >=20 >=20 >=20 --=-iWALlNK8IFiGqXQwreYx--