Is there a way to change the order data from the database? you know, the default order is that they are read from the first data inserted last, so is there a way to change it to last-> first?
the default order is that they are read from the first data inserted in the last
, . , . ORDER BY, . , , , .
, order by. , , insert_date, NOW() :
insert_date
NOW()
ORDER BY `insert_date` DESC
, , .
. , Engine Engine.
, , InnoDB, PRIMARY KEY, MyISAM
InnoDB
PRIMARY KEY
MyISAM
( , ) ORDER BY DESC.
ORDER BY DESC
. ORDER BY , .
ORDER BY
: "ORDER BY" SQL-, timestamp, / .
(ORDER BY myTimestampField DESC)
SELECT * FROM {tablename} ORDER BY id DESC
The above assumes that you have an identifier field that grows with each insertion. You may also have a field of type CreateDate, which you can use in the ORDER BY statement.
ORDER BY will be ascending by default, so in order to get-> first, use DESC.
Source: https://habr.com/ru/post/1746201/More articles:Parallel programming, don't we learn from history again? - designC # Looping the process and until the user presses the key - c #Accessing Helper Functions / Procedures from DPR or Other Functions / Procedures in Delphi - subroutineShould all methods that have a return value turn into a property? - .nethttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1746200/mock-repository-vs-real-repository-wmocked-data&usg=ALkJrhgBNB5Tdn17z7liUvwcEZImQkVqsAКто-нибудь еще предпочитает архитектуру N-уровня после того, как * отправил * приложение MVC? - language-agnosticHow to use cscope in visual studio? - visual-studio-2008Нужен простой совет для решения проблемы графа - algorithmHow to run VBA code when a cell changes? - vbaSession variables persist after logging out - phpAll Articles