var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Are WHERE NOT IN queries possible?
is WHERE NOT IN possible
I am just moving accross to MySQL from Access.
Something I regulalrly do in Access to create selection lists is to wirite a SELECT query that excludes records that are already in another related table. something along the lines:
SELECT * FROM mytable WHERE id NOT IN (SELECT id FROM myothertable)
(syntax may not be quite right, its been I while since I did it)
Is anything similar possible with MySQL? and if so any clues to the syntax.
I have no knowedge of MySQL, but I would try the following.
SELECT * FROM mytable a WHERE NOT EXISTS (SELECT * FROM myothertable b where a.id = b.id )
I re-write NOT IN as NOT EXISTS in MS SQL because it is faster.
mysql does not do subselects prior to release 4.1
use an outer join instead, testing for unmatched rows
SELECT * FROM mytable
left outer join myothertable
on mytable.id = myothertable.id
where myothertable.id is null
thanks Rudy I will give it a try
I've been in the same situation. Thanks for clearing that up!