SELECT 
       chip_id AS stage_id
FROM chipRun 
       LEFT JOIN remoteComponent ON (remoteComponent.stage_id = chipRun.chip_id) 
       LEFT JOIN remoteRun ON (
       	    remoteComponent.remote_id = remoteRun.remote_id AND 
	    remoteRun.label = chipRun.label
	    )
WHERE
chipRun.state = 'new' AND
(remoteRun.stage = 'chip' OR remoteRun.stage IS NULL) AND
remoteComponent.remote_id IS NULL



       