DBD::Pg::st execute failed: ERROR: column "customer_id" does not exist Error! SELECT ct.name AS vendor, ct.curr AS currency, ct.id AS vendor_id, current_date + ct.terms AS duedate, ct.notes, ct.curr AS currency FROM vendor ct WHERE ct.id = (select customer_id from ap where 1 = 1 AND vendor_id IS NOT NULL order by id DESC limit 1) ERROR: column "customer_id" does not exist