SQl question

  • Thread starter Thread starter Ivan Sammut
  • Start date Start date
I

Ivan Sammut

Hi,

Is there any sql command which can find defined text in specific fields. For
example I have a table with names like "Ivan Sammut" etc. Now I want to
create a statment which select all those records which contain the text
"Ivan" or those that contain the text "Sammut". Is there a way I can achieve
this with an SQL statement.

Ivan
 
Hi!

Ivan Sammut wrote:

[...snip...]
Is there any sql command which can find defined text in specific fields. For
example I have a table with names like "Ivan Sammut" etc. Now I want to
create a statment which select all those records which contain the text
"Ivan" or those that contain the text "Sammut". Is there a way I can achieve
this with an SQL statement.
[...snip...]

Your posting might yield better results in a sql newsgroup, but anyway:

select
*
from
yourtable
where
firstfield like '%Ivan%'
or
secondfield like '%Ivan%'
or
firstfield like '%Sammut%'
or
secondfield like '%Sammut%'
;

You'll need to include every column you want to check into the where-clause.
It might be a good idea to split the search into multiple select-statements
in case you are searching for more words...
 
Landi wrote:

[...snip...]
try microsoft.public.sqlserver.programming
[...snip...]

....or the one of the countless sql newsgroups that is the most appropriate
for the op's rdbms ;-)

There is more out there than MS's SQLServer.

SCNR
Michael
 
Back
Top