大神来帮忙写写SQL语句完成功能
如图,有表内字段的说明,右边有功能说明,在图片上面能看到全部内容。帮忙写下SQL语句完成功能,谢谢。有信息不清楚的可以问。...
如图,有表内字段的说明,右边有功能说明,在图片上面能看到全部内容。
帮忙写下SQL语句完成功能,谢谢。有信息不清楚的可以问。 展开
帮忙写下SQL语句完成功能,谢谢。有信息不清楚的可以问。 展开
展开全部
SELECT
d.Memo as 工号,
l.LName as 姓 ,
l.FName as 名,
b.BugID as 任务ID,
b.Bugtitle as 任务标题,
b.CurrentOwner as 当前负责人,
d.Project as 所属项目组,
c.Status_Custom_1 as 综合得分
from DevelopLine d,
LogIn l,
Bug b,
CustomerFieldTrackExit c
where l.PersonID = b.CurrentOwner
and b.BugID = c.BugID
and d.Memo = l.Memo
and (b.PlanedStartDate between '2014-05-01' and '2014-05-31')
and (b.PlanedEndDate between '2014-05-01' and '2014-05-31')
and b.PlanedStartDate<b.PlanedEndDate
d.Memo as 工号,
l.LName as 姓 ,
l.FName as 名,
b.BugID as 任务ID,
b.Bugtitle as 任务标题,
b.CurrentOwner as 当前负责人,
d.Project as 所属项目组,
c.Status_Custom_1 as 综合得分
from DevelopLine d,
LogIn l,
Bug b,
CustomerFieldTrackExit c
where l.PersonID = b.CurrentOwner
and b.BugID = c.BugID
and d.Memo = l.Memo
and (b.PlanedStartDate between '2014-05-01' and '2014-05-31')
and (b.PlanedEndDate between '2014-05-01' and '2014-05-31')
and b.PlanedStartDate<b.PlanedEndDate
展开全部
--以下语句是假设DevelopLine表与Bug表是通过 员工姓名=当前负责人来关联的
select 工号=A.Memo,人员姓=B.LName,人员名=B.FName,任务ID=C.BugID,任务标题=C.BugTitle,当前负责人=C.CurrentOwner,所属项目组=A.Project,综合得分=D.Status_Custom_2 from DevelopLine A
left join LogIn B on A.Memo=B.Memo
left join Bug C on A.Name=C.CurrentOwner
left join CustomerFieldTrackExit D on C.BugID=D.BugID
select 工号=A.Memo,人员姓=B.LName,人员名=B.FName,任务ID=C.BugID,任务标题=C.BugTitle,当前负责人=C.CurrentOwner,所属项目组=A.Project,综合得分=D.Status_Custom_2 from DevelopLine A
left join LogIn B on A.Memo=B.Memo
left join Bug C on A.Name=C.CurrentOwner
left join CustomerFieldTrackExit D on C.BugID=D.BugID
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询