Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2007-02-06 : 12:51:33
|
Trying to build a search engine and I need to search 3 fields in one table. Like if someone types in "I am a big fan of the colts". Can someone point me in the right direction how to do a search for the words in the 3 fields?Dave |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-02-06 : 13:58:18
|
SELECT ...FROM YourTableWHERE Column1 = 'I am a big fan of the colts.' OR Column2 = 'I am a big fan of the colts.' OR Column3 = 'I am a big fan of the colts.'You can also use LIKE if you are looking for that text somewhere in the column.Oh and I love the Chargers!!! We'll be back!Tara Kizer |
|
|
X002548
Not Just a Number
15586 Posts |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-06 : 14:09:53
|
SELECT distinct c.*FROM YourTable as ccross apply dbo.fnSplit('I am a big fan of the colts.', ' ') as xWHERE c.Column1 = x.part or c.Column2 = x.part OR c.Column3 = x.partPeter LarssonHelsingborg, Sweden |
|
|
X002548
Not Just a Number
15586 Posts |
|
helixpoint
Constraint Violating Yak Guru
291 Posts |
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|