sqlite3.OperationalError: no such column

2.2k Views Asked by At

The following works in SQLite Manager, but doesn't in Python. I get the following error:

sqlite3.OperationalError: no such column: domain_list.short_name

I've tried taking out the "AS domain_list" and referring to just "short_name" and also "websites.short_name" but it still doesn't work in Python. But does in SQLite Manager. It works ok with just the sub query, just not when I join the subquery to the domain_info table.

Any ideas?

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
0

There are 0 best solutions below