On 3/22/2015 8:50 AM, Bart Smissaert wrote:
> select g.gp_name, d.emis_number from DIABETIC_ISSUES_LAST d
> inner join patients p on(d.emis_number = p.emis_number)
> inner join gp_table g on(p.usual_gp_index_number = g.gp_id)
> where d.emis_number not in(select DB.emis_number from DIABETICS DB)
>
> I get:
>
> no such column: DB.emis_number

So, the table DIABETICS doesn't have a column named emis_number

> This runs fine:
>
> select emis_number from DIABETIC_ISSUES_LAST
> where emis_number not in(select emis_number from DIABETICS)

emis_number in the sub-select is DIABETIC_ISSUES_LAST.emis_number, not 
DIABETICS.emis_number

> So, how should I do this?

First, you have to figure out *what* you are trying to do. In light for 
the fact that DIABETICS doesn't have a column named emis_number, it's 
not at all clear.
-- 
Igor Tandetnik

Reply via email to