sql - Select rows in master table which have NO join in subtable -


i have 2 tables: result (master) , confirmation(sub):

create table result (   result_id serial not null   constraint result_pkey primary key (result_id) )  create table confirmation (   confirmation_id serial not null,   result_id integer   constraint confirmation_pkey primary key (confirmation_id),   constraint confirmation_result_id_fkey foreign key (result_id)       references result (result_id) match simple       on update no action on delete no action ) 

i'm able find results having confirmation:

select  result.result_id, confirmation.confirmation_id result join confirmation on confirmation.result_id = result.result_id 

but need vice-versa - results still without single confirmation.

select * result not exists (select 1 confirmation confirmation.result_id = result.result_id) 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -