找到子表中超过500条记录的数据

select a.BusinessId,count(1) as count1,b.PlantNo,b.VendorCode
from Payment_Details a,Payment_Master b where a.BusinessId=b.BusinessId
and b.StartTime='2024-09-01'
group by a.BusinessId,b.PlantNo,b.VendorCode having count(1)>500

 

精华在having count(1)>500

posted @ 2025-11-13 17:18  老飞飞  阅读(0)  评论(0)    收藏  举报