code:
1
2
3
4
5
6
7
8
9
10
| SELECT td.tododetail_id, td.todo_id, td.tododetail_volgnr, UNIX_TIMESTAMP( date_format( tododetail_einddatum, '%Y-%m-%d') ) as einddatum FROM tododetail as td, todo as t WHERE t.todo_id = td.todo_id and td.status_id=1 OR td.status_id=7 OR td.status_id=8 order by einddatum, status_id, prioriteit_id asc |
Ik wil met de bovenstaande query alle todo items ophalen uit de todo en tododetail tabel waar de status 1, 7 of 8 is.
Als ik deze query nu uitvoer krijg ik een groot cartetisch product van 199 rows ipv de 37 records die in de database zitten.
Het is nu zo dat in de tabel todo de unieke todo items staan en in de tododetail de status, einddatum enz, de koppeling is het todo_id.
Wat doe ik verkeerd?