sql查询  同一个字段  同时满足多个条件
如表: id        商品id             商品属性       属性内容
             id     productId             attr           content
             1              1                    颜色             红色
             2              1                    长度             10厘米
             3              1                    宽度              20厘米
             4              2                    颜色              红色
             4              2                    长度              20厘米
我就想从这个表中找出  颜色为红色,长度为10厘米   的商品的id             结果应该是 1  
请问各位查询语句怎么写呢?  在线等!
------解决方案--------------------
如果你能确保 ( 商品id , 商品属性)唯一性。则可以
SQL code
select productId
from 如表
where (attr='颜色' and content='红色')
or (attr='长度' and content='10厘米')
or (attr='宽度' and content='20厘米')
group by productId
having count(*)=3