using sa 11.0.1.2331

This works fine:

SELECT cms_content.*
   FROM dba.cms_content
   WHERE CONTAINS (  title, intro, body, footer , 'hello' )

According to the docs, this should retrieve scoring info:

SELECT cms_content.*, ct.*
   FROM dba.cms_content
   WHERE CONTAINS (  title, intro, body, footer , 'hello' ) ct
order by ct.score desc

But iSQL reports a "syntax error near ct on line 3"

What am I missing here?

PS: I tried variations on

SELECT cms_content.*, "contains".score
   FROM dba.cms_content
   WHERE CONTAINS (  body , 'hello' ) 

but all I get is syntax errors there as well

asked 22 Jul '10, 09:59

Vincent%20Buck's gravatar image

Vincent Buck
70681520
accept rate: 15%


Scoring is supported only if the CONTAINS clause is part of the table expression (specified in the FROM clause). Only if specified as a table expression is the implicit "score" column added to the projection of the underlying table. For example,

SELECT *
FROM MarketingInformation CONTAINS ( Description, 'cotton' ) as CT
WHERE CT.score > <some value>;

By adding a correlation name, you can use multiple CONTAINS table expressions within the same query, and refer to each search score independently by qualifying the "score" column by the given correlation name.

permanent link

answered 22 Jul '10, 10:44

Glenn%20Paulley's gravatar image

Glenn Paulley
10.7k571104
accept rate: 43%

edited 22 Jul '10, 10:49

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×137
×15
×1

question asked: 22 Jul '10, 09:59

question was seen: 606 times

last updated: 22 Jul '10, 10:49