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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Inside the string

Author  Topic 

BUser
Starting Member

11 Posts

Posted - 2010-10-06 : 19:18:43
Hello !

Table A has the following columns

ID & Description.

Now, ID & Description can have the following values -

ID Description

11 Cotton
232 Cotton Wool

2322 Corn
6566 Corn husk


Now, how do I find out all the columns that have the similar data like above. What you might have observed here is this that, for 11 & 232, they BOTH have COTTON in their description.

Now, how do I write my query.

Thanks,
Don.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-06 : 19:19:16
Can you use FULLTEXT?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

BUser
Starting Member

11 Posts

Posted - 2010-10-06 : 19:20:32
TKizer, thank you for the quick reply.

No, I dont know how to do that... I was thinking more like substring, instring...on those lines & cant seem to get it ...

Please advise !
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-06 : 19:23:07
Here you go:
http://msdn.microsoft.com/en-us/library/ms142571.aspx
http://msdn.microsoft.com/en-us/library/ms187787.aspx
http://www.developer.com/db/article.php/3446891/Understanding-SQL-Server-Full-Text-Indexing.htm

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

BUser
Starting Member

11 Posts

Posted - 2010-10-06 : 19:29:34
TKizer, thank you for the reply. Yes, I will use contain and got answer.

Can you please also post answer for my previous question. that is different thred.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-06 : 19:31:19
It is too lengthy for me at the moment, I am pressed for time.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -