这就是我想要做的
WITH
loc_id AS ( // take the result of the following select statement
SELECT l.location_id
FROM mopdb.lulocation l
WHERE (l.location_short = 'FOO'))
SELECT d.device
FROM mopdb.ludevice d
LEFT JOIN lulocation l ON (d.location_id = l.location_id)
WHERE (d.location_id = loc_id) //use it here