Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. +-------+-----+-----+---------+
  2. |vocabId|docId|count| word|
  3. +-------+-----+-----+---------+
  4. | 1| 1| 1000| plane|
  5. | 1| 3| 100| plane|
  6. | 3| 1| 1200|motorbike|
  7. | 3| 2| 702|motorbike|
  8. | 3| 3| 600|motorbike|
  9. | 5| 3| 2000| boat|
  10. | 5| 2| 200| boat|
  11. +-------+-----+-----+---------+
  12.  
  13. select r1.word,r2.word, count(*) from result_T r1 JOIN result_T r2 ON r1.docId = r2.docId and r1.word = r2.word group by r1.word, r2.word
  14.  
  15. select r1.word,r2.word, count(*) from result_T r1 JOIN result_T r2 ON r1.docId = r2.docId and r1.word = r2.word group by r1.word, r2.word
  16.  
  17. boat, motorbike, 2
  18. motorbike, plane, 2
  19. boat, plane, 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement