How can I order my result set, but also have a specific row (s fieldX = Y) that will be the first?
fieldX = Y
Something like this should work:
ORDER BY (fieldX = Y) DESC, whateverField ASC
select tbl.*, if(fieldX = Y, 1, 0) as custom_sort from tbl order by custom_sort desc, fieldZ asc
Now, whatever the Z field, the row with the X = Y field will always be the first in the result set
Source: https://habr.com/ru/post/1759884/More articles:How to request / update remote RDF endpoint using Jena - jenaFacebook новый API все еще требует xdreceiver? - facebookДелает ли asp.net mvc Url.Content кодировку строки? - asp.net-mvcAllow bad time error format in java? - javahow to convert varchar in time in java? - javaHow to add security attributes for a non-admin account in the creatnamedpipe win API method - c #Using Match in a Linq Expression - 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/1759887/queries-to-get-all-ancestorsdescendents-of-a-tree-in-a-db&usg=ALkJrhg4dEER24jIq9aCFj3Ef-pKtxA1JQОпределение сборки подкласса методом в базовом классе - reflectionHow to run SQL queries in MDB files? - sqlAll Articles