Last post Mar 10, 2010 05:35 PM by Naom
Mar 06, 2010 08:19 AM|Vexander|LINK
I have a relatilvy simple query I need to complicate.
The query is
SELECT TOP (100) COUNT(1) AS Count, KeyWords
GROUP BY KeyWords
ORDER BY 'Count' DESC
This returns the results
I need to slpit this to count each of the word about, I need it to split on the comma. Can I do this in SQL?
Thank you in advance
Mar 06, 2010 11:10 AM|interrupt1985|LINK
May be these ld help you
Mar 08, 2010 11:16 AM|KumarHarsh|LINK
will this, help
Mar 10, 2010 05:18 PM|Vexander|LINK
Hi Guy's thank you for all you replies, unnfortunatley it does not seem, form you answeres like I am going to be abel to do this in SQL the way that I would like to, so I will just do it in vb. Thank you for your time
Mar 10, 2010 05:35 PM|Naom|LINK
Very simple to count words - you just need to find the number of occurrences of the comma, e.g.
select top 100 KeyWords, len(Keywords) - Len(replace(KewWords,',','')) as NumberOfWords from myTable order by NumberOfWords DESC
Also quite recently there was a thread on this topic in tek-tips forum - I'll search later.