user1352918
user1352918

Reputation: 19

sql where contains

TABLE A
|column1|column2| 

TABLE B
|column1|column2| 

SQL QUERY

SLECT a.column1
b.column
FROM A a, B b
Where Contains(a.column1, b.column1)

But, it has syntax error near b.column in Contains.

Upvotes: 0

Views: 900

Answers (2)

Chotip
Chotip

Reputation: 54

I think you cannot specify column name into the search condition.

CONTAINS can search for:

  • A word or phrase.
  • The prefix of a word or phrase.
  • A word near another word.
  • A word inflectionally generated from another (for example, the word drive is the inflectional stem of drives, drove, driving, and driven).
  • A word that is a synonym of another word using a thesaurus (for example, the word "metal" can have synonyms such as "aluminum" and "steel").

Ref: http://msdn.microsoft.com/en-us/library/ms187787.aspx

Upvotes: 0

Tobi
Tobi

Reputation: 1438

You missed a comma?

SELECT a.column1, b.column1
FROM A a, B b
Where Contains(a.column1, b.column1)

Upvotes: 5

Related Questions