1

唯一已知的变量是 Item(在本例中为 Car)

我想运行一个查询,它显示与我知道的 Item 颜色相同的所有行。

例如.. 我想运行汽车查询。

SELECT * from TABLE WHERE(项目颜色与汽车颜色匹配)

ITEM             COLOR
Car              Blue
House            Red
Boat             Green
Jetski           Red
4

3 回答 3

1

编辑

select * from table where color = (select color from table where item = 'Car');
于 2012-10-29T05:47:20.167 回答
0

这也有效:

select table.*
from table inner join table table_1 using (COLOR)
where table_1.ITEM = 'Car';
于 2012-10-29T06:21:24.163 回答
0
select * from table where color In (select color from table where item = 'Car');
于 2012-10-29T05:57:47.620 回答