No Such Column in SQLite Temporary Table Statement

126 Views Asked by At

I have two SQLite tables (companies and complaints) I'm using to calculate a ratio of HR complaints to employees, but when attempting to run the query below in DB Browser, I'm getting this error:

-- Result: no such column: complaints.hrcomplaints

Here's the SQL I'm using:

CREATE TEMPORARY TABLE newratio AS SELECT companies.uniqueID, employees, complaints.hrcomplaints,
       (ROUND(hrcomplaints * 100.0 / employees, 1)*.01) AS newratio
FROM companies
ORDER BY newratio

The column type for both hrcomplaints and employees is integer. I'm not seeing any extra whitespace in the column names when viewing the DB structure.

0

There are 0 best solutions below