【mysql45讲】什么时候会使用内部临时表union&group by

1.什么时候会使用内部临时表 1.1 union 举例: (select 1000 as f) union (select id from t1 order by id desc limit 2); 这里的内存临时表起到了暂存数据的作用,而且计算过程还用上了临时表主键 id 的唯一性约束,实现了 union 的语义。 如果把上面这个语句中的 union 改成 union all 的话,就没有了“去
相关文章
相关标签/搜索