MySQL Forums
Forum List  »  Views

Re: Help with conceptualizing a query
Posted by: Peter Brawley
Date: November 18, 2013 09:50PM

You need to change the name of `phase-page`; '-' is illegal in an identifier.

> I need a unique list of all the tasks within phases 1-X

Where did 'task' come from? What table.column does it refer to in your DDL? Do you mean a page identified by list_page.ID? If so, does this begin to address what you mean?

select l.number, l.phase, ifnull(p.pageID,'') as page
from list_phase        l
left join phases_pages p on l.ID=p.phaseID
where l.project_id=1
order by l.number;

If so, then if that's a subquery, an outer aggregating query could easily figure out the minimum phase for which is not null.

Options: ReplyQuote

Written By
November 14, 2013 03:24PM
November 17, 2013 12:10AM
November 18, 2013 01:20PM
Re: Help with conceptualizing a query
November 18, 2013 09:50PM

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.