作者JYHuang (夏天到了,冷不起来了说)
看板Database
标题[MySQL] 同Table中的交集运算
时间Fri May 22 03:13:35 2009
有Table Product,Feature,Product_Feature
Product是放产品资料的资料
Feature的架构是一个清单式的列表
id Feature
1 DVI
2 HDMI
3 DisplayPort
4 ......
Product_Feature是对照表 (那些Product有那些Feature)
Pid Fid
1 1
1 2
2 1
3 1
我想挑出同时有DVI 跟HDMI的Pid (只有1符合)
用where Fid In(1,2)的话 1,2,3都会被包含在内
where (Fid=1 AND Fid=2) 也不被接受
请问有什麽方法可以做交集式的筛选呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.104.153.30