(select * from customers where installations.customer_id = customers.id and customers.deleted_at is null) or exists (select * from products where installations.product_id = products.id and products.deleted_at is null)) and installations.deleted_at is null"
is this what you want the query to look like?
Обсуждают сегодня