1. sql查找一列中呈现次数大于8的记录
select
`POID`
from
`orderDetail`
group by
`POID`
having count(*) >8;
2. SQL查找汇合中的记录
select
`OID`
from
`orderHead`
where
`OID` in (
select
`POID`
from
`orderDetail`
group by
`POID`
having count(*) > 8
);
发表回复