1

I created a table and inserted values into it but they are not storing in orderly manner.
The table looks like:
data grid

I can order them by using ORDER BY but it does not change them permanently. Is there a way to save them in orderly manner permanently.

Clarification: I don't want how they are stored internally, what I want is when ever I execute select * from cricket; the results to come sequentially. So that I don't want to use ORDER BY clause every time. Is there a way?

ypercubeᵀᴹ
  • 99,450
  • 13
  • 217
  • 306
dvr
  • 11
  • 2

2 Answers2

3

Without an ORDER BY clause, you have no guarantees as to the order the rows are presented to you, even if they 'look' ordered when you run a select. Bullet 1 of this link

https://msdn.microsoft.com/en-us/library/ms188385.aspx

Scott Hodgin - Retired
  • 24,062
  • 2
  • 29
  • 52
2

[link] http://dev.mysql.com/doc/refman/5.7/en/alter-table.html

It suggests

ALTER TABLE 'tablename' ORDER BY 'ColumnName';
Priyanka Kariya
  • 483
  • 2
  • 10