Cyberbit interview question

Sql Question + Write a string by the frequency sort of each char