I have a table with 5 columns (primary_key, abstractid, sentid, wordid, term).
This query pulls up a list of distinct terms that appear in less than 6 distinct abstractid's.
SELECT
term, COUNT(distinct abstractid) AS "num"
FROM
nsfabstracts
HAVING
COUNT(distinct abstractid) < 6
GROUP BY
term
ORDER BY
"num" DESC;
How would I modify the above query to count the number of rows it returns instead? Also, how would I delete all rows associated with the above query?