List:MySQL and PHP« Previous MessageNext Message »
From:admin Date:February 21 2012 11:00pm
Subject:Inner Join Question
View as plain text  
I have an issue where I am joining a table on a table.

The problem is the table I am joining has more than one row of matching
data.

 

 

SELECT `customer`.`name`, `comments`.`note` FROM customer

INNER JOIN  `comments` ON `customer`.`id` = `comments`.`customer`

WHERE 

`customer`.`join_date` >= "2012-01-01 00:00:00"

ORDER BY `customer`.`join_date`

ASC

 

 

I need to return all the customers and the last note for each customer

But what I get is a list with the repeat of each customer for each note.

 

 


Thread
Inner Join Questionadmin21 Feb
  • Re: Inner Join QuestionJohn James Rambo22 Feb