admin管理员组文章数量:1193805
I have a strange issue running this MySQL query:
SELECT
aid, listingStatus
FROM
navigation_token_assignment,
article
WHERE
navigation_token_assignment.aid=article.id
AND navTokenId=29
AND listingStatus NOT IN (3,4)
AND id=2001451
LIMIT 1;
This Code returns this answer:
aid | listingStatus
2001451 | 4
Why is NOT IN not resolved correctly? The xpeceted outcome would be Nothing (or at least not listingStatus=4).
It also does not work with AND listingStatus!=3 AND listingStatus!=4
What would be a possible fix to this problem?
I have a strange issue running this MySQL query:
SELECT
aid, listingStatus
FROM
navigation_token_assignment,
article
WHERE
navigation_token_assignment.aid=article.id
AND navTokenId=29
AND listingStatus NOT IN (3,4)
AND id=2001451
LIMIT 1;
This Code returns this answer:
aid | listingStatus
2001451 | 4
Why is NOT IN not resolved correctly? The xpeceted outcome would be Nothing (or at least not listingStatus=4).
It also does not work with AND listingStatus!=3 AND listingStatus!=4
What would be a possible fix to this problem?
Share Improve this question edited Jan 23 at 16:55 Levi Pike asked Jan 23 at 16:45 Levi PikeLevi Pike 1951 silver badge8 bronze badges 1 |1 Answer
Reset to default 5Just a guess: try to check the type of listingStatus, maybe it's not an integer and type casting is needed here
本文标签: MySQL NOT IN () does not exclude wenn connecting 2 TablesStack Overflow
版权声明:本文标题:MySQL NOT IN () does not exclude wenn connecting 2 Tables - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738480328a2089103.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
SELECT aid, listingStatus FROM navigation_token_assignment JOIN article ON navigation_token_assignment.aid=article.id WHERE navTokenId=29 AND listingStatus NOT IN (3,4) AND id=2001451 LIMIT 1;
– Levi Pike Commented Jan 23 at 16:52