SELECT 
       stack_id AS stage_id
FROM stackRun 
       LEFT JOIN remoteComponent ON (remoteComponent.stage_id = stackRun.stack_id) 
       LEFT JOIN remoteRun ON (
       	    remoteComponent.remote_id = remoteRun.remote_id AND 
	    remoteRun.label = stackRun.label
	    )
WHERE
stackRun.state = 'new' AND
remoteRun.stage = 'stack' AND
remote_id IS NULL
