selectdistinct c1_0.id,
c1_0.orderDate,
o2_0.customerOrder,
o2_0.id,
o2_0.amount,
o2_0.deleted,
p1_0.id,
p1_0.productName,
s1_0.id,
s1_0.city
from
customerOrder c1_0
left join
orderPosition o1_0
on c1_0.id=o1_0.customerOrder
and o1_0.deleted=false
left join
orderPosition o2_0
on c1_0.id=o2_0.customerOrder
left join
product p1_0
on p1_0.id=o2_0.product
left join
address s1_0
on s1_0.id=c1_0.shippingAddress_id