I have a table containing the fields A, B, C, D. Suppose I do a sample of the data from the fields A and B. Is it possible to do ordering on the field C with the given fields of the sample?
For example:

select A, B from table where ..... order by C 

Is ordering allowed by a non-sampled field?

  • Yes. If there is no grouping. When grouping, it can cause an error if group operations and the server mode of STRICT are applied to this field - Dmitry Kozlov
  • Is ordering allowed by a non-sampled field? Sorting is permissible according to any expression that is permissible in the output list (as a first approximation, you have nothing to do with exceptions yet). Can I add a field to the output set? Yes. So, you can sort by it. Ps. Here's a word, it was faster to try than to ask and wait for an answer ... - Akina

0