views:

308

answers:

2

How do I sort the query results by keyword occurrence in column? I'm using SQL Server 2008 with Full-text indexing.

A: 

select * from tablename order by columnname

Is that what you're looking for?

Ian Devlin
No, I meant the keyword occurrence, for example, if this keyword is "car", record A contains 3 occurrence and record B has 5, then record B should rank higher.
+1  A: 

select columnname, count(columnname) as cnt from tablename group by columnname order by count(columnname) desc

kedar kamthe