1
我有一個表Setpoints
其中包含3列Base
,Effective
和Actual
其中包含一個id
是指io
發現該項目的參考價值。查找多列
我想提出的查詢將返回在io
表的id
在Setpoints
發現找到了io_value
。
目前我的查詢將返回多個id
的,然後我查詢io
表中查找io_value
每個id
。
防爆查詢返回的ID行
row # | base | effective | actual
1 | 24 | 30 | 40
2 | 25 | 31 | 41
3 | 26 | 32 | 42
中,但我想它返回值,而不是ID的
例爲ID的,而不是
row # | base | effective | actual
1 | 2.3 | 4.5 | 3.44
2 | 4.2 | 7.7 | 4.41
3 | 3.9 | 8.12 | 5.42
這裏返回值是表字段
IO
io_value
io_id
Setpoints
stpt_base
stpt_effective
stpt_actual
現在使用
SELECT * from setpoints
For each row
SELECT io_id, io_value
from io
where io_id in
(stpt_effective, stpt_actual, stpt_base);
// these are from previous query