table1
row_id row_one row_two
1 1 5
2 1 5
3 2 5
4 2 5
5 2 6
table2
row2_id row2_one row2_two
1 1 somevalue
2 2 somevalue2
"select distinct row_one from table1 where row_two=5"
结果
row_one
1
2
之后我要选择
select * from table2 where row2_one=1
select * from table2 where row2_one=2
我想用一个查询进行选择。我正在尝试这个查询
select * from table2 where row2_one in (select distinct row_one from table1 where
row_two where row_two=5)
但花了 8s
Showing rows 0 - 14 ( 15 total, Query took 8.3255 sec)
为什么这么慢。我想更快地选择。请帮我!