in的效率太慢!
select * from table1 where id in(1,2,3,4,5,6,7,8,9)
怎么才能提高效率呢?不用in?不会,求指教。
[解决办法]
--id 列上有索引的情况下select * from table1 where id = 1union allselect * from table1 where id = 2union allselect * from table1 where id = 3union allselect * from table1 where id = 4union allselect * from table1 where id = 5union allselect * from table1 where id = 6union allselect * from table1 where id = 7union allselect * from table1 where id = 8union allselect * from table1 where id = 9
[解决办法]