The most efficient way to do this is to connect yourself:
SELECT * FROM attributes a1
JOIN attributes a2 USING (item_name)
WHERE a1.value = 'green' AND a2.value = '4 legs';
Another solution that some people use is the GROUP BY trick:
SELECT item_name FROM attributes
WHERE value IN ('4 legs', 'green')
GROUP BY item_name
HAVING COUNT(*) = 2;
GROUP BY , JOIN, , RDBMS . .