Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Query syntax for CONTAINS

0 views
Skip to first unread message

Andy Wilton

unread,
Jun 15, 2001, 5:04:19 AM6/15/01
to
I have a table with a string column and would like to issue a SELECT
statement that basically gives me all rows where the string column contains
'TEST'

I also would like to perform a similar select statement but where the string
column begins with 'TEST'

Any ideas ?


Thanks in advance

Andy Wilton

PS. MS SQL 7

Bradley M. Small

unread,
Jun 15, 2001, 11:22:23 AM6/15/01
to
Try

--For contains 'TEST'
select * from MyTable where stringColumn like '%TEST%'

--For StartsWith 'TEST'
select * from MyTable where stringColumn like 'TEST%'

--For EndsWith 'TEST'
select * from MyTable where stringColumn like '%TEST'

-- Bradley

"Andy Wilton" <A...@profitmaster.co.uk> wrote in message
news:992595951.14112.0...@news.demon.co.uk...

0 new messages