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 |
|
english_twit
Starting Member
3 Posts |
Posted - 2005-08-12 : 07:53:51
|
| Hi allI have two tables.Keywords TableKeywords |SIC Code |Thomson Code |School |8010 | 44444 |Turnip |4444 | 555555 |Break |99999 | 33333 |Company FileVendor | Add1 | Add2 | etc etcPrimary School | High Street | etcTurnip Farm | Countryside | etcBreakdown Serv | Industrial |Turnip School Break | Kidding! | What I need is a query that will match all the keywords in the keywords table in the Vendor field of the Company file table. i.eVendor | Keyword(s)9 |Primary SChool | School |Turnip Farm | TurnipTurnip School Break | SChool,Turnip,Break |I can get the query reporting singluarlary, but not the last option.Apologies if this looks basic... but I am struggling!RegardsDomEr yes. That worked. What?<edit> Moved to appropriate forume </edit> |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-12 : 08:05:53
|
| Try thisSelect V.vendorCode from vendor V , Keyword K where vendorcode like '%'+K.keycode+'%'MadhivananFailing to plan is Planning to fail |
 |
|
|
english_twit
Starting Member
3 Posts |
Posted - 2005-08-12 : 09:09:57
|
| Madhivananthis is great but I don't see the keywords that match. SO for instance this is the result that I getVendor Name Postcode KeywordABBEYFIELDS DAY NURSERY#002 ME13 8DL NurseryABBEYFIELDS DAY NURSERY#002 ME13 8DL DayBut the result I want to see isVendor Name Postcode KeywordABBEYFIELDS DAY NURSERY#002 ME13 8DL Nursery,Daybecause I am matching on DAY and NURSERYOnce again, apologies if this seems simple, but I'm not really a techie!RegardsDomEr yes. That worked. What? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
english_twit
Starting Member
3 Posts |
Posted - 2005-08-12 : 10:19:13
|
| MadhivananExcellent - it'll take me a while to figuer this out for me, but it's what i need. I'll do it when I return from vaction in two weeks (what a get out)Many thanksDomEr yes. That worked. What? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-12 : 10:26:07
|
>>I'll do it when I return from vaction in two weeks (what a get out)wellHave a nice vacation MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|