Hello ALL,
I have a table as follows
Code:
ID Cate. Word
1 Sports basketball
2 Sports football
3 SPorts volleyball
4 Economy share
5 Economy bank
6 Economy credit
7 Economy basketball
8 Society credit
9 Society democracy
10 Society people
11 Society basketball
I would like to query about those words which occur in less than 3 (<3) categories.
In the above example, the query result should be all entries except for entries corresponding to 'basketball', i.e., all excluding entries 1, 7, 11.
I used the following statement
Code:
Select *
From TableName
Group By
Word
Having Count(*)<3
Order by
Cate
However, I got less entries than expected by this statement.
For a word, only one entry is returned. e.g. for 'credit'
I have
while I expect
Code:
6 Economy credit
8 Society credit
it seems that the clause 'group by' lead to this result. How can I do to get the right answer?
Please help