注册 登录
编程论坛 SQL Server论坛

sql语句查询问题

zcdjt 发布于 2018-11-29 18:25, 1945 次点击
select DepartmentName,SectionOffice,

(select count(*) ShareScore from tblTaskFlowRecord where OperationType in (2, 3) and a.UseWechatOpenId=UseWechatOpenId) ShareCount
我想求详情,但是a.UseWechatOpenId=UseWechatOpenId这个算出来是所有的,请问怎么展开?

from (select distinct UseWechatOpenId from tblTaskFlowRecord a) a
join SysUser c on a.UseWechatOpenId = c.OpenId
left join tblDepartmentRelation d on c.Mobile = d.Phone
0 回复
1