SQL string matching
From: abracad <abracad_at_hotmail.com>
Date: 8 Mar 2003 16:03:41 -0800
Message-ID: <94e19a8d.0303081603.1ddf2d69_at_posting.google.com>
I am trying to create a SQL query that will search a text field for a particular word, say 'tin'. I want to ensure it finds only the word
'tin', and not the characters 'tin' as part of another word, eg
'postings'.
Date: 8 Mar 2003 16:03:41 -0800
Message-ID: <94e19a8d.0303081603.1ddf2d69_at_posting.google.com>
I am trying to create a SQL query that will search a text field for a particular word, say 'tin'. I want to ensure it finds only the word
'tin', and not the characters 'tin' as part of another word, eg
'postings'.
I can create a query such as:
SELECT desc
FROM Table1
WHERE desc LIKE '% tin %' OR desc LIKE 'tin %' OR desc LIKE '% tin' OR
desc='tin'
But is there a shorter or more efficient way of accomplishing the same objective?
Thanks in advance Received on Sun Mar 09 2003 - 01:03:41 CET