问题描述
我正在尝试创建一个报告取决于签名表。这是我的查询
如果文档已完成,那么此查询将根据签名提供完整的文档结果。但是当我想要时得到不完整的文档结果这个查询没有给我结果而没有使用where子句我不知道怎么能完成= 0
SELECT Employees.FirstName,Employees.LastName,Signatures.Employee_ID,Signatures.Document_ID,Documents.Topic,Documents.Complete,Documents.Created,
Documents.RevisionLevel
来自员工INNER JOIN
签名签名.Employee_ID = Employees.ID INNER JOIN
文件ON Signatures.Document_ID = Documents.ID
其中Documents.Complete = 0
我尝试过:
我尝试使用SQL连接来获得所需的结果
I am trying to create a report depends upon a signature table.Here is my query
If the document is complete then this query is giving complete document result based on the signature.But when I want to get incomplete document result this query is not giving me result and without using where clause I don't know how I can get complete = 0
SELECT Employees.FirstName, Employees.LastName, Signatures.Employee_ID, Signatures.Document_ID, Documents.Topic, Documents.Complete, Documents.Created,
Documents.RevisionLevel
FROM Employees INNER JOIN
Signatures ON Signatures.Employee_ID = Employees.ID INNER JOIN
Documents ON Signatures.Document_ID = Documents.ID
where Documents.Complete = 0
What I have tried:
I tried SQL Joins to get the desired result
推荐答案
所以,这意味着WHERE不是你的问题:它是正在移除它们的JOIN。
手动找到应该在输出中的行 - 它有一个零 - 并查看JOINed字段 - 为什么不包含它?直到你知道这一点,你无法解决这个问题:我根本无法访问你的数据!
So, that means that the WHERE is not your problem: it's the JOINs that are removing them.
Manually find a row that should be in your output - that has a zero - and look at the JOINed fields - why isn't it included? Until you know that, you can't fix this: and I have no access to your data at all!
事实上我们无法访问你的为你做的这些数据在三天内没有改变;也不会在另外三个!
The fact that we cannot access your data to do that for you has not changed in three days; nor will it in another three!
这篇关于如何从where子句获取不完整的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!