Hello, i have a database and I want to sort the a column according to the number of words included in each field.
Ex:
a b (has 2 words)
a b c d e (has 5 words)
a b c (has 3 words)
And i want 'a b c d e' to be the first in sort result, and 'a b c' the second. .. etc
Do you have a solution fot it?
Edit: Thanks guys for quicly answers! All answers was good but meanwhile i solved using same sollutions found here mysql-substr-count