How to sort query results using more than 1 properties?
For example, I want to sort the results of my query by "last name" and sort by "first name" in each "last name" group.
You tried:
Person.all (). Order ("last name"). Order ("Firstname")
Just use two comma separated orders, for example:
SELECT * FROM person ORDER BY lastname, firstname
See here for more details .
Source: https://habr.com/ru/post/1715233/More articles:Slow MySQL query - performanceHow to get the exact decibel level using Cocoa? - cocoaHow do I make sure that the HTML form elements have not been modified for hacking on the client side before submitting? - securityDataTemplate, LoadContent, and DataTriggers do not fire - wpfThe best way to get the first digit from a variable-length integer in VB.NET - vb.netGetting functions from another script in JS - javascriptDo I need to design the application architecture while supporting Azure? - architectureC # error: "Class" is unavailable due to protection level - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1715237/can-i-do-this-in-powershell-read-the-registry-write-out-binary-contents-to-file&usg=ALkJrhhh3pi1AXm3U7bJv8zJegfuXla9QQOutputting the return type of a function or functor in C ++ - c ++All Articles