This is a discussion on sql select within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi all, I need to do a keyword search against database table (MSSQL 2000) on particular field/column, say the ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all, I need to do a keyword search against database table (MSSQL 2000) on particular field/column, say the keyword: "sql server 2000". The search should return without any order restrictions, so it might return result contain '2000' and 'sql' and 'server', or can return that contain 'server' only. appreciate any advice. thanks from Jemy. |
| |||
| Thanks David, Im thinking if there are any other resorts to this using regular expression in sql select, and if possible results are returned in order of preference (from mostly match). Im not sure why I want to use other resort, but it seems using mix 'or' and 'and' doesnt return closest match result. "David Portas" <REMOVE_BEFORE_REPLYING_dportas@acm.org> wrote in message news:MqSdnV7CXvv4x6DcRVn-hA@giganews.com... > SELECT ... > FROM YourTable > WHERE col LIKE '%sql%' > OR col LIKE '%server%' > OR col LIKE '%2000%' > > -- > David Portas > SQL Server MVP > -- > > |
| ||||
| Jemy (cutejemy@REMOVEhotmail.com) writes: > Im thinking if there are any other resorts to this using regular > expression in sql select, and if possible results are returned in order > of preference (from mostly match). Im not sure why I want to use other > resort, but it seems using mix 'or' and 'and' doesnt return closest > match result. There are no regular expressions in SQL like in, say, Perl, so David's suggestion is about the best you can get, unless you want to explore full-text indexing. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp |
| Thread Tools | |
| Display Modes | |
|
|