var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: display records that do not exist in another table
I have following tables and respective fields:
I want to display those models that do not exist in the current group.. the group_code is the code of the group..
I have tried following query but it does not return anything from it... my query is
select distinct a.model_code, a.display_name from models a,group_models b where b.model_code<>a.model_code and b.group_code='0012' order by a.display_name
I also tried following nested query it says that I have an error in the sql syntax :
select distinct model_code, display_name
where model_code not in (select distinct model_code from group_models where group_code='0012')
Will be waiting for an urgent response... as this really is an urgent matter
select distinct a.model_code, a.display_name from models a,group_models b where b.model_code=a.model_code and b.group_code!='0012' order by a.display_name
re the nested query, which version of MySQL are you using?
from models a
join group_models b
and b.group_code = '0012'
where b.model_code is null