S
S
Sergey2020-06-17 12:43:54
SQL
Sergey, 2020-06-17 12:43:54

How to sort by text field and occurrence of substring?

How to sort by a text field exactly by the occurrence of a substring? description is a description and in the selection, first get the products with certain occurrences in this field.
SELECT * FROM goods ORDER BY description

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2020-06-17
@oldzas

SELECT * FROM goods 
  ORDER BY CASE WHEN [с определенными вхождениям] THEN 0 ELSE 1 END, description

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question