MySQL Forums
Forum List  »  PHP

One to many concept
Posted by: madan ray
Date: February 22, 2013 12:03AM

Hi,

I have two tables
Table 1:
projects---fields: id, title created, updated

Table 2:
tasks----fields: id, project_id, title, start_date, due_date, created, updated

Questions:

I need all those projects whose task due_date crossed the current date uniquely

Note: There may be multiple task for one projects

I have written the following query but it's showing duplicate records:

SELECT p.* FROM projects p LEFT JOIN tasks t ON p.id=t.project_id WHERE t.due_date<current date

Options: ReplyQuote


Subject
Written By
Posted
One to many concept
February 22, 2013 12:03AM
February 22, 2013 08:28AM
February 22, 2013 11:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.