implement the frequency sql generator for annotext mode