Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW have count of words (in a field) for orderby ?

Status
Not open for further replies.

hercule2

Programmer
Nov 30, 2003
12
FR
FROM ASP with access 2000 database :

<%
Set m_Conn = server.CreateObject(&quot;ADODB.Connection&quot;)
m_Conn.Open &quot;eq14CVs&quot;, &quot;&quot;, &quot;&quot;
SQL = &quot;Select TOP 5 [field] as toto from table orderby fct([field],'the_word') desc&quot; ' MyFunc is not permit here
Set rs = m_Conn.Execute(SQL)
Do
If (rs.EOF) Then Exit Do
response.write rs(&quot;toto&quot;) & &quot;<br>&quot;
rs.MoveNext
Loop
%>

I would like to obtain an order with occurence of a word.

Do you know a &quot;fct([field],'the_word')&quot; ?

It is not possible to create and use with ADO a replace function, so i need an another solution.


Example :
order by (len([field])-len(Replace([field],'the_word','''',1,-1,1)))/len('the_word') desc&quot;


I don't want use the replace function under ASP because the database have 15000 rows to order. It's too big to do with ASP.

Please, help me.


 
you should
select count(*) as occurence from table where word = &quot;domething&quot;
or
select count(*) as occurence, word from table group by word

this is a question for SQL forum, not for ActiveX.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top