我有两个表。用SQL查询计数字出现
表1:
ID SENTENCE
1 The shoes are good shoes.
2 There is a tree.
3 This is nice, nice, nice!
表2:
ID WORD
1 The
1 shoes
1 are
1 good
1 shoes
2 There
2 is
2 a
2 tree
3 This
3 is
3 nice
3 nice
3 nice
我需要统计从表1的每一句话每一个字的发生。如果任何单词出现多次(> 1),则计算它不要跳过它。最终结果表应该是这样的:
ID SENTENCE CNT
1 The shoes are good shoes. 2
2 There is a tree.
3 This is nice, nice, nice! 3
对于有趣的问题+1。 – bonCodigo 2013-02-27 11:00:45
http://whathaveyoutried.com。特别是如果这是一个家庭作业问题。 – 2013-02-27 11:03:36
'table1'与'table2'有什么关系?第二只是第一个的另一种表现形式? – 2013-02-27 11:05:56