#2
wube2018-12-19 20:36
|
有一段查询数据库语法
1. Select A.ProjectNo, D.CateMainName,D.CateSubName ,B.ItemNo,B.ItemName,C.CreateDate,C.CreatorNo,C.DHRemark
FROM tblProject As A
INNER JOIN tblProjectItem As B On A.ProjectNo=B.ProjectNo
INNER JOIN tblProjectDevpHistory As C On B.ProjectNo=C.ProjectNo And B.ItemNo=C.ItemNo
INNER JOIN tblBasCategory As D On A.CateMainID=D.CateMainID and A.CateSubID=D.CateSubID
Where C.CreateDate>'2018-12-16' and C.CreateDate<'2018-12-22' order by A.CateMainID
这样写会变成以下表栏位 :
ProjectNo CateMainName CateSubName ItemNo ItemName CreateDate CreatorNo DHRemark
2. 1怎么结合COUNT(*)变成下方表栏位?
No. ProjectNo CateMainName CateSubName ItemNo ItemName CreateDate CreatorNo DHRemark