如何快速按列之一对MySQL表重新排序? [英] How to quickly re-sort a MySQL table by one of the columns?

查看:194
本文介绍了如何快速按列之一对MySQL表重新排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最有效的SQL查询将采用现有的MySQL表并按其中一列对其进行重新排序,这是最有效的SQL查询?不是选择,而是整个表格应按一列排序.我想以某种方式使用临时表,但是最好的方法是什么?

What are the most efficient SQL queries that would take an existing MySQL table and re-sort it by one of the columns? Not a selection, but the whole table should be sorted by one column. Somehow using a temporary table, I guess, but what's the best way?

推荐答案

表只是其固有排序的数据.从该表中获取数据的查询可以排序,但表本身不可以.

the table is just the data its not inherently sorted. a query obtaining the data from that table may be sorted, but the table itself is not.

在要对查询进行排序的列上具有索引将有助于提供最佳的查询时间.

Having indexes on the columns you want your queries to sort on will help give the best query time.

这篇关于如何快速按列之一对MySQL表重新排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆