34,588
社区成员
发帖
与我相关
我的任务
分享
---要求编写sql语句查询2006年8月1日~31日每一天的当月累计 fyp
select Company,Agencyid,Productid,Wrcvdate,
Fyp=(select sum(Fyp) from 表B where a.Company=Company and a.Agencyid=Agencyid and a.Productid=Productid and Wrcvdate<=a.Wrcvdate)
from 表B
where cast(Wrcvdate as datetime) between '2006-8-1' and '2006-08-31'
第一个不明白是什么意思?
---要求编写SQL语句查询(companycode,policycode,crtable)组合键值重复的记录明细.
select * from
表C a
where (select count(1) from 表C where a.companycode=companycode and a.policycode=policycode and a.crtable=crtable)>1