SQL 嵌套查询语句,
求各位大神指点是否逻辑有错误,因为这语句搜不出任何数据。select*fromAwhere((ActualDateisnotnull)andMilestoneId='4'...
求各位大神指点是否逻辑有错误,因为这语句搜不出任何数据。
select * from A where ( (ActualDate is not null) and MilestoneId='4'
and CreateDate in(select MAX(CreateDate) from A group by ProjectId )
and ProjectId in(select ProjectId from B where (IsSuppressed is not null)and (ProjectStatus is null) or ProjectStatus='0')
) order by ABS(DATEDIFF(mi,[ActualDate],getdate())) asc 展开
select * from A where ( (ActualDate is not null) and MilestoneId='4'
and CreateDate in(select MAX(CreateDate) from A group by ProjectId )
and ProjectId in(select ProjectId from B where (IsSuppressed is not null)and (ProjectStatus is null) or ProjectStatus='0')
) order by ABS(DATEDIFF(mi,[ActualDate],getdate())) asc 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询