Get ranking of words over date based on frequency in PostgreSQL
问题 I have a database that stores twitter data: Create Table tweet( ID BIGINT UNIQUE, user_ID BIGINT, created_at TIMESTAMPTZ, tweet TEXT; I'm trying to write a query that goes through the words in tweet for all rows gets the frequency of each word, and returns the top ten most frequent words along with the words' ranking over each date. Example: ("word1":[1,20,22,23,24,25,26,27,28,29,30,29,28,27,26,25,26,27,28,29,30,29,28,29,28,27,28,29,30,30,...], 'word2' [...]) My current query gets the top ten