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
 searching within a string

Author  Topic 

do_singh
Starting Member

2 Posts

Posted - 2008-05-09 : 06:34:57
I'm having problems constructing an SQL statement to find records from a user entered string searching record. a record consists of a comma separated string. for example:

user entered string: charts
record: bars, graphs, charts

i've tried:

SELECT MI_FILENAME, MI_EXT, MI_KEYWORDS
FROM MEDIA_ITEMS
WHERE (MI_KEYWORDS IN ('bars'))

Could u offer any assistance please

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-05-09 : 06:48:32
LIKE ?
i.e....

SELECT MI_FILENAME, MI_EXT, MI_KEYWORDS
FROM MEDIA_ITEMS
WHERE MI_KEYWORDS like '%bars%'

Em
Go to Top of Page

do_singh
Starting Member

2 Posts

Posted - 2008-05-09 : 07:03:32
cheers matey
Go to Top of Page
   

- Advertisement -