视图
SELECT id, SchoolId, SchoolNo, SchoolName, FullName,
(SELECT COUNT(*) AS Expr1
FROM dbo.Car
WHERE (ISDel = 0) AND (CarState = 2) AND (CheckZhuXiao <> 2) AND (SchoolId = dbo.School.SchoolId)) AS CarCount, RegMan, Tel, Mobile, Fax, BusiLicence,
RegLicence, Address, TechType, Signer, SignerImg, SchoolState, LatLng, Area, Remark, JSchoolNo, SchoolIntroduction
FROM dbo.School
WHERE (IsDelete = 0)
视图中可以使用子查询 和函数