[SOLVED] Record sorting SQLite lazarus / 16-Databases ---------------------------------------------------------------------- Pe3s · 2023-11-18 16:18 Hello, is it possible to sort records in such a way that the database remembers the sorting? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.SpeedButton5Click(Sender: TObject);begin   ZQuery1.SQL.Text := 'SELECT * FROM users ORDER BY Name ASC';   ZQuery1.ExecSQL;   ZQuery1.Open;end; ---------------------------------------------------------------------- BSaidus · 2023-11-18 16:45 Short answer: NO Quote from: Pe3s on November 18, 2023, 05:18:04 pmHello, is it possible to sort records in such a way that the database remembers the sorting? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.SpeedButton5Click(Sender: TObject);begin   ZQuery1.SQL.Text := 'SELECT * FROM users ORDER BY Name ASC';   // Use ExecSQL if you need to Insert, Update, Delete a record ( in this case you do not need it )   // ZQuery1.ExecSQL;   ZQuery1.Open;end; ---------------------------------------------------------------------- Pe3s · 2023-11-19 18:19 Is there no way to do it in alphabetical order? ---------------------------------------------------------------------- dsiders · 2023-11-19 18:50 Quote from: Pe3s on November 19, 2023, 07:19:38 pmIs there no way to do it in alphabetical order? 'order by NAME asc' is alphabetic order. IF you want case-insensitive alphabetic order use the 'COLLATE NOCASE clause. Code: MySQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SELECT * FROM users ORDER BY Name COLLATE NOCASE ASC You can apply collate to the schema too. ---------------------------------------------------------------------- Pe3s · 2023-11-23 10:25 Thank you