本人优快云博客专栏:https://blog.youkuaiyun.com/yty_7
Github地址:https://github.com/yot777/
最近由于工作原因沉迷于SQL,今天有一个重要发现:
在表的数据量很大又没有索引的时候先where之后再group by的查询速度极低,因此不能直接写:
select account, sum(money) from table
where account = '某些账号'
group by account;
要写成:
select u.ac