SELECt youtable.
FROM yourtable
WHERe articleid IN (SELECt articleid
FROM yourtable
WHERe (fieldsid, value) IN ((1,1),(2,1))
GROUP BY articleid
HAVINg COUNT()=2)
编辑:如果只需要第一条记录:
SELECt youtable.*FROM yourtableWHERe id IN (SELECt MIN(id) FROM yourtable WHERe (fieldsid, value) IN ((1,1),(2,1)) GROUP BY articleid HAVINg COUNT(*)=2)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)