Stefan Hinz wrote:


Okay, here for another wild guess:


SELECT u.login, p.name, sp.name, SUM(t.time)
FROM t_user u
LEFT JOIN t_project p ON 1
LEFT JOIN t_subproject sp ON p.id = sp.project_id
LEFT JOIN t_time t ON ?? = ??
WHERE u.login = 'amg'
GROUP BY p.name

Where I'm not sure if you will need the WHERE clause at all.


Hi Stefan,


thanks for your answer,

This query doesn't work for me.

It gives back a Sum of time but this is wrong.

Example:
+-------+----------------------+-----------------+----------+
| login | name                 | name            | SUM      |
+-------+----------------------+-----------------+----------+
| amg   | Administration       | database minimum|      120 |
| amg   | Allgem. Verbesserung | database upgrade|        0 |
| amg   | Ausbildung           | Intern          |     2512 |
| amg   | Ausfallkurve IPM     | NULL            |        0 |
| amg   | Betreuung / Besprech | database minimum|        0 |
| amg   | Bezahlte Absenzen    | hvjm            |        0 |
| amg   | Bogie Tools          | Support         |      360 |
| amg   | CCP                  | CCP             |        0 |



Mistake 1: There are no time entries for subproject database minimum at all.
Mistake 2: There are time entries for the subproject 'Intern' but thy dont belong to 'amg'


and so on...


I really don't get it ... :-(


Thanks anyway
  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