- 积分
- 40165
- 好友
- 记录
- 主题
- 帖子
- 听众
- 收听
|
发表于 2015-4-2 08:17:15
|
显示全部楼层
select * from(
SELECT s.Id as Id,s.Name as Name,avg(s.Phone) as Phone FROM dbo.OrganizationPoint AS o
INNER JOIN [dbo].[Employment] AS e ON o.OrganizationId=e.EmployingUnitId
INNER JOIN dbo.Student AS s ON s.Id =e.StudentId
INNER JOIN dbo.Major AS m ON s.MajorId = m.Id
inner join dbo.Organization as j on j.Id = e.EmployingUnitId
left join Organization o1 on m.collegeId=o1.Id or o1.Id=4 or o1.parentId=4
where j.DistrictCode like '51%'
group by s.Name,s.Id
) as t 这样不就和了,下面应该怎么写就怎么写 |
|