I am trying to run a query on a SQLite database that INNER JOIN
s two additional tables:
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)
However, I get the error
SQL error: cannot join using column item_id - column not present in both tables
I know I can use the explicit INNER JOIN stores ON usages.store_id = stores.store_id
(and it works), but:
why does the USING
query throw an error in SQLite?
It doesn't on MySQL...
I should note:
This isn't a problem for me, as I am using the ON
syntax, but I would like to know why this is happening.