mysql数据库中这条sql语句让我懵逼了,请各位小伙伴给我指点迷津
mysql数据库中有2张表,book2024表(书表)和booktype2024表(书类型表);
如下这条sql语句让我很疑惑,如下这条sql语句是我突发奇想写的,一般不会这么写,就是搞不明白为什么这么写会查到如下结果?
SELECT
*
FROM
book2024,
booktype2024
WHERE booktype2024.id IN (book2024.bTypeId = booktype2024.id);
如下这条sql语句也让我很疑惑:
SELECT
*
FROM
book2024,
booktype2024
WHERE booktype2024.id IN (book2024.bTypeId <> booktype2024.id);
如下这条sql语句也让我很疑惑:
SELECT
*
FROM
book2024,
booktype2024
WHERE booktype2024.id NOT IN (book2024.bTypeId <> booktype2024.id);