var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: how to query for words appearing in ONLY one doc
I have a table like
I would like to find words which are unique for classes(i.e., words which appear only in one class), e.g.
ClassID Class Word Freq
1 Sports basketball 3
1 Sports Football 2
1 Sports Volleyball 3
2 Education Basketball 2
2 Education Music 1
3 Art Picture 3
3 Art Football 3
I figure out the following query statement
but i am not sure. please help me.
SELECT ID, Class, Word FROM tlb GROUP BY Word HAVING COUNT(Class) = 1;
Last edited by cy163; 04-23-09 at 10:52.
SELECT Word FROM tlb GROUP BY Word HAVING COUNT(*) = 1
i did not know what is the difference between COUNT(*) and COUNT(ColumnName) in a query statement. could you please explain this for me. Thanks.
did you check da manual? it's pretty clear on the difference
COUNT(*) counts rows
COUNT(ColumnName) counts non-NULL values