My database schema is like following
table - X has following 3 columns docid(document id), terms(terms in document), count(number of terms of occurence of the term for specific docid)
docid
terms
count
How to extract the information as for the following The number of docid where sum of total words is more than 300 including duplicate words.