我正试图在一个sqlite数据库上运行一个查询,
INNER JOIN
S两个附加表:
SELECT
usages.date AS date,
usages.data AS data,
stores.number AS store,
items.name AS item
FROM usages
INNER JOIN stores USING (store_id)
INNER JOIN items USING (item_id)
但是,我得到了错误
SQL error: cannot join using column item_id - column not present in both tables
我知道我可以用直白的
INNER JOIN stores ON usages.store_id = stores.store_id
(这是可行的),但是:
为什么
USING
查询在sqlite中引发错误?
它不在MySQL上…
我应该注意:
这对我来说不是问题,因为我正在使用
ON
语法,但我想知道为什么会发生这种情况。