Dear Friends,

I would like to know how to find exact word from a text data available in SQL String.

I mean,

Suppose I have a string available in Table1; ie , "My latest activities"

I want to search the word like test.

Currently I am using query

select * from Table1 where subject like "%test%"

That time it is showing the subject like above because of 'latest'. But I want the rows that exactly contains the word test.


Kindly help me....

This is an approximation to the solution of the problem, in MSSQL:

select * from Table1  where subject like '%[^A-Za-z0-9]test[^A-Za-z0-9]%'
OR Description_ENG like '%[^A-Za-z0-9]test'
OR Description_ENG like 'test[^A-Za-z0-9]%'

[^A-Za-z0-9] means that the word "test" can be sorrounded by anything but letters and numbers. Unfortunately I didnt find a way to specify a string pattern with ZERO or more characters NOT beginning with a specified set.

Hope this helps!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.