我有以下 SQL 语句
SELECT be.*, it.order_number
FROM songs AS be
INNER JOIN
(
SELECT song_id, order_number
FROM items
WHERE order_status = 1
) it
ON be.id = it.song_id
INNER JOIN orders AS or
ON it.order_number = or.order_number
WHERE be.active = 0
我似乎无法理解为什么这个语句没有产生任何结果。当我删除以下行时;
INNER JOIN orders AS or
ON it.order_number = or.order_number
它似乎产生了结果,我知道表中order_number
确实存在orders
- 所以它显然是不正确的语法,但我不知道从哪里开始?感谢帮助。