I have problem getting the SQL output I want.
I have two tables like this:
tblOrder
ID User Status 1 1 0 2
The main problem I found that I had done was write O.ID = OI.ID instead of O.ID = OI.OrderID. Thats why I only got one row per ID. I should have seen that but I only thought of other problems. Thanks for the help!
O.ID = OI.ID
O.ID = OI.OrderID