kimai / www.kimai.org

Website for the Kimai time-tracker
https://www.kimai.org
GNU Affero General Public License v3.0
18 stars 88 forks source link

SQL documentation uses LEFT JOIN #444

Open fulldecent opened 3 months ago

fulldecent commented 3 months ago

Describe the issue

On the page https://www.kimai.org/documentation/sql-examples.html

it shows several SQL queries.

Here is one example:

SELECT
    c.name as Customer,
    u.username as Username,
    u.alias as User,
    FORMAT(SUM(t.duration) / 3600, 0) as Duration
FROM
    kimai2_timesheet t
        LEFT JOIN kimai2_projects p on t.project_id = p.id
        LEFT JOIN kimai2_customers c on p.customer_id = c.id
        LEFT JOIN kimai2_users u on t.user = u.id
GROUP BY
    c.id, t.user, c.name, u.username, u.alias
;

This shows LEFT JOIN on projects and users. But it also seems from the GUI that those are required fields. If that is case then these should instead be JOIN instead.

I already tried

Kimai version

2

How do you run Kimai?

KIMAI CLOUD

Which PHP version are you using?

8.1

Logfile

No response

Screenshots

No response