MySQL Forums :: PHP :: trouble figuring out joins, any gurus out there?


Advanced Search

trouble figuring out joins, any gurus out there?
Posted by: Mike M ()
Date: August 31, 2009 11:23AM

I am trying to do some kind of join but I'm not sure the difference and which one I should be using.

I have the following tables

todo
- todo_id
- title
(6, do yard work)
(7, do something at work)

todo_tag (links todo to tags, each task can have more than one tag)
- todo_id
- tag_id
(6, 3)
(6, 5)
(7, 4)

tag
- tag_id
- value
(3, home)
(4, work)
(5, yard)

project (all a project is is a group of tags and we list all the todos that have one of those tags)
- project_id
- project name
(1, my home projects)
(2, someone elses project)

project_tag
- project_id
- tag_id
(1, 3)

All the info I have is a project_id (1) and from that I want to get all the tags connected to the todos that have that the project tag (home). the tags I should get from the query are: 3,5

any direction would be appreciated

Options: ReplyQuote


Subject Written By Posted
trouble figuring out joins, any gurus out there? Mike M 08/31/2009 11:23AM
Re: trouble figuring out joins, any gurus out there? Rick James 09/01/2009 10:30PM
Re: trouble figuring out joins, any gurus out there? Mike M 10/04/2009 08:33PM
Re: trouble figuring out joins, any gurus out there? Mike M 10/04/2009 08:51PM


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.