Hebben tips m.b.t. hoe ik de onderstaande code kan herschrijven tot alleen maar 'joins' aangezien 'where' en 'join' schijnbaar niet samengaan. 
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| SELECT
*
FROM
products
WHERE
categories.category_id = $var
AND
categories.category_id = categories_products.category_id
AND
categories_products.product_id = products.product_id
INNER JOIN
brands
ON
products.brand_id = brands.brand_id
INNER JOIN
energy_classes
ON
products.energy_class_id = energy_classes.energy_class_id
INNER JOIN
washing_results
ON
products.washing_result_id = washing_results.washing_result_id
INNER JOIN
dry_results
ON
products.dry_result_id = dry_results.dry_result_id
INNER JOIN
product_conditions
ON
products.product_condition_id = product_conditions.product_condition_id
INNER JOIN
warranties
ON
products.warranty_id = warranties.warranty_id |