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 |
dnf999
Constraint Violating Yak Guru
253 Posts |
Posted - 2006-12-05 : 06:19:24
|
Hi I need to remove company words from the Company_Name field for matching purposes.i.eCompany_Name MATCH Company_Name (what I want my results to be!)------------ ------------------ABC Ltd ABCABC Limited ABCABC Ltd Corp ABC123 Public 123123 Plc Public123 Public CoI am trying to use in IN statement to identify where there are keywords:Query:SELECT Company_Name from Table1 where Company_Name in (' Ltd', ' Plc') etc. (list of keywords...)Problem:This query is not picking out the company with these keywords. Any suggestions, I would like to identify the rows with these key words and strip them out for matching purposes.Thanks!! |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-05 : 06:27:22
|
[code]SELECT Company_Name from Table1 where Company_Name like '% Ltd%' or Company_name like '% Plc'[/code] ...etcHarsh AthalyeIndia."Nothing is Impossible" |
 |
|
dnf999
Constraint Violating Yak Guru
253 Posts |
Posted - 2006-12-05 : 07:15:57
|
Thanks, i wrote a loop to replace the characters instead. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-05 : 10:13:07
|
quote: Originally posted by dnf999 Thanks, i wrote a loop to replace the characters instead.
Can you post the code you used?MadhivananFailing to plan is Planning to fail |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-05 : 10:24:34
|
SELECT t.Company_Namefrom Table1 tcross join Keywords kwhere t.Company_Name like '%' + k.reservedword + '%'Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|