唯一已知的变量是 Item(在本例中为 Car)
我想运行一个查询,它显示与我知道的 Item 颜色相同的所有行。
例如.. 我想运行汽车查询。
SELECT * from TABLE WHERE(项目颜色与汽车颜色匹配)
ITEM COLOR
Car Blue
House Red
Boat Green
Jetski Red
唯一已知的变量是 Item(在本例中为 Car)
我想运行一个查询,它显示与我知道的 Item 颜色相同的所有行。
例如.. 我想运行汽车查询。
SELECT * from TABLE WHERE(项目颜色与汽车颜色匹配)
ITEM COLOR
Car Blue
House Red
Boat Green
Jetski Red
编辑:
select * from table where color = (select color from table where item = 'Car');
这也有效:
select table.*
from table inner join table table_1 using (COLOR)
where table_1.ITEM = 'Car';
select * from table where color In (select color from table where item = 'Car');