Linked Questions
14 questions linked to/from What is the default order of records for a SELECT statement in MySQL?
2
votes
1
answer
7k
views
MySQL not using PRIMARY KEY to sort by default [duplicate]
I have a large MySQL table on 5.6.35-81.0 Percona Server with gaps in the PRIMARY key. The table has around 53 Million records and the auto-increment key is now at around 370 million. The table is a ...
1
vote
2
answers
651
views
How to store table values in order [duplicate]
I created a table and inserted values into it but they are not storing in orderly manner.
The table looks like:
I can order them by using ORDER BY but it does not change them permanently. Is there a ...
0
votes
1
answer
67
views
MySQL 8 can view be deterministic view? [duplicate]
I made a huge jump from MySQL 5.7 to MySQL 8 NDB. and it seems to me that in the earlier version when I queried a view I got answers more deterministic than now. Seems like it was ordered by something ...
14
votes
3
answers
14k
views
Why is SSMS inserting new rows at the top of a table not the bottom?
Whenever I manually insert a row into a table in SQL Server Management Studio 2008 (the database is SQL Server 2005) my new row appears at the TOP of the list rather than the bottom. I'm using ...
7
votes
4
answers
1k
views
Does an IOT guarantee order in a select?
We need to add a priority column to a table that gets hit about 250 times a second, approx 170 selects, 125 inserts and 60 updates. The column will be a simple number(1).
The priority does not matter ...
8
votes
1
answer
5k
views
Storage order vs Result order
This is a spin-off question from Sort order specified in primary key, yet sorting is executed on SELECT.
@Catcall says this on the subject of storage order (clustered index) and the output order
A ...
-5
votes
3
answers
1k
views
Does "deprecated" in MySQL means "not guaranteed" or "still guaranteed"?
MySQL 3.23/4.0/4.1 and 5.1 states:
If you use GROUP BY [ for select ], output rows are sorted according to the GROUP BY columns as if you had an ORDER BY for the same columns. ➫➫➫
However, MySQL 5....
2
votes
1
answer
893
views
What is the order when SELECT-ing unordered set from an ordered SELECT?
What does the SQL standard and its mainstream DB implementations (SQL Server, Oracle, DB2, PostgreSQL, Firebird, MySQL, etc.) say about the final order in the following general case:
SELECT * FROM (...
2
votes
1
answer
839
views
weird sql server behavior when inserting and selecting
Today after one of the drives on our sql server ran out of space. The drive contained eventracker logs, so I didn't think it was a big deal, but then I noticed when I insert a record into a database, ...
3
votes
3
answers
888
views
MySQL: ORDER BY useless?
CREATE TEMPORARY TABLE tt;
INSERT INTO tt; many times
SELECT FROM tt ORDER BY id LIMIT ?,1000;
The temp table is created at the beginning of the script having an "id" auto_increment column (and ...
1
vote
1
answer
747
views
Set in mySQL a predefined order for SELECT queries without using the ORDER BY clause
I have a MySQL database and users access it through an old legacy software (OLS) the company bought years ago. OLS connects to MySQL through MySQL ODBC driver. There is no way to change OLS in recent ...
0
votes
1
answer
93
views
Why does my LIMITed SELECT fetch the last record of the table, not the first?
I read that to fetch the first table record, you may use LIMIT 1. I tried to apply that knowledge to my JOIN statement and got a diametrically opposite result. It joined the last record of the joined ...
1
vote
2
answers
135
views
JSON_AGG automatically sorting data
On running the below query data coming from JSON_AGG gets automatically sorted. But I do not want to sort data.
What can I do ?
select r.id, r.name, r.description,
STRING_AGG(...
0
votes
3
answers
53
views
Does MySQL have an "order" type that enforces data integrity? Or does any database support this?
Web dev here, typical scenario at work - I have a list of items that can be reordered using an UI. Upon reordering, I want the database to update.
Using MySQL I've always found this process very ...