Đây là một truy vấn mẫu:
SELECT
itemName
FROM
items i,
JOIN
item_properties effect
ON i.itemId = effect.itemId AND effect.property = 'effect'
JOIN
item_properties consumption
ON i.itemId = consumption.itemId AND consumption.property = 'consumption'
WHERE effect.value = 'cooling' AND consumption.value = 'efficient';
Tôi sẽ để lại oR truy vấn như một thứ gì đó bạn có thể tự thử. Nó chỉ đơn giản là thêm nhiều bảng hơn và sử dụng OR thay vì AND trong WHERE .