[ sql, query ]

Hi all,

I've got a problem and I really can't solve it by myself :-(

I want a Select-Statement which gives me following output:

Projectname / Subprojectname / user   / hours
-------------------------------------------
testproject / subproject1    /  mas   / 1
testproject / subproject1    /  hud   / 2
testproject / subproject1    /  keh   / 5

testproject / subproject2    /  mas   / 1
testproject / subproject2    /  hud   / 0
testproject / subproject2    /  keh   / 3

testproject / subproject3    /  mas   / 1
testproject / subproject3    /  hud   / 3
testproject / subproject3    /  keh   / 5
-------------------------------------------

So I want to know which user worked how long on the subprojects of a
certain project.
My database looks like that:

t_time:         id, hours, subproject_id, user_id
t_user:         id, name
t_subproject:   id, name,project_id
t_project:      id, name

a subproject can have X times and a project X subprojects.
subproject_id in t_time is linked with id in t_subproject, project_id in
t_subproject is linked with id in t_project.


How can I do that? I did some left joins but didn't get the right result.


Thanks
    Sorin









---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Reply via email to