Nested query classic case! !
Article Source: 山 夜
Http://www.33d9.com
Select [username], (Select Count (*) from company where comid = t1.username) AS recruitment station, (Select Count (*) from trainorg where orgid = t1.username) AS training institution, (Select Count (*) from Train_company WHERE COMID = T1.Username) AS Training Company, (Select Count (*) from COM_CLASS WHERE COMID = T1.USERNAME) AS Campus Recruitment, (Select Count (*) from Cjoleng.dbo.companyinfo Where CompanyID in (SELECT [ID " ] from combaseuser where [username] = T1. [username])) AS English station from Combaseuser T1Group by [username] HAVING Count (*)> 1