0
這就是我想要做的如何將一個select語句的結果用作另一個變量的結果?
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