select id,(select sum(test_field
) from test2 where test_id = test2_id) as total from test order by total limit 5
类似这样的sql 会导致过慢 有什么解决的方案吗
select id,(select sum(test_field
) from test2 where test_id = test2_id) as total from test order by total limit 5
类似这样的sql 会导致过慢 有什么解决的方案吗
4 回答1.5k 阅读✓ 已解决
8 回答1.3k 阅读
3 回答1k 阅读✓ 已解决
3 回答1.1k 阅读✓ 已解决
3 回答1.9k 阅读
2 回答1.7k 阅读
1 回答907 阅读✓ 已解决
你这个查询一共就一条数据为什么还要用子查询,还要 order by?