以下はSQLiteManagerで機能しますが、Pythonでは機能しません。次のエラーが発生します。
sqlite3.OperationalError:そのような列はありません:domain_list.short_name
「ASdomain_list」を取り出して「short_name」と「websites.short_name」だけを参照してみましたが、Pythonではまだ機能しません。しかし、SQLiteManagerではそうです。サブクエリをdomain_infoテーブルに結合するときではなく、サブクエリだけで問題なく機能します。
何か案は?
SELECT
*
FROM
(
SELECT
websites.short_name
FROM
websites
INNER JOIN product_info ON product_prices.product_info_id = product_info.id
WHERE product_info.archive = 1
GROUP BY
websites.short_name
) AS domain_list
LEFT JOIN
domain_info
ON
domain_list.short_name = domain_info.domain
ORDER BY
last_checked