mdsk.net
当前位置:首页 >> SQL A列相同 B列相同 C列平均值 >>

SQL A列相同 B列相同 C列平均值

可以

select * from ( select id,code,name,ROW_NUMBER() over(PARTITION by code order by name) as num from tablename ) T where T.num

A列种类数=SUMPRODUCT(1/COUNTIF(A1:A5,A1:A5)) B列种类和=SUMPRODUCT(B1:B5/COUNTIF(A1:A5,A1:A5)) C列和=SUM(C1:C5)

试试看 同xf_storecode,同xf_contractdesc,同xf_leasemode进行集合处理 select a.xf_storecode, b.xf_contractdesc, a.xf_tendercode, sum(a.xf_payamount), b.xf_leasemode from xf_transsalestender a, xf_bscontracth b where a.xf_storeco...

select (case when a>b then a else b end), (case when b>c then b esle c end) from table_name

建表 create table t(a int,b int)insert into t values (1,2)insert into t values (2,3)执行 select a,b,case when b in (select a from t) then 1 else null end from t结果

select a,b,c,count(*) as 重复记录 from 表 group by a,b,c

select case when first_name>middle_name then case when first_name>last_name then first_name else last_name end else case when middle_name>last_name then middle_name else last_name end end as name from member

这样写: update a set a.D=b.C from 表1 a join 表2 on a.B=b.A 是个关联的UPDATE语句而已

update A表 set A=b/c

网站首页 | 网站地图
All rights reserved Powered by www.mdsk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com