SQLselect : RegEx search records where field DOES NOT contain string

Fred.Stephenson Fred.Stephenson at wanadoo.fr
Wed Mar 26 14:45:34 CST 2003


>  >> I'd like to launch a SQL Query to get records that DOES NOT contain a
>>>  specified string, something like :
>>>
>>>  SELECT * FROM myTable WHERE myStrField NOT LIKE 'ABC' no_case
>>>
>>>  Any clue?
>>
>>  But your query must work.  No?
>
>Example:
>Rec 1 : myStrField = "ABCDEF"
>Rec 2 : myStrField = "ABC"
>Rec 3 : myStrField = "DEF
>
>SELECT * FROM myTable WHERE myStrField NOT LIKE 'BCD' no_case
>
>...would return me Rec 2 and Rec 3, but not Rec 1
Looks fine to me?? the only one it shouldn't return is record 1 (or 
did I have too much wine with my lunch ?;)) as it "contains" 'BCD'
If you want to do a "starts with" then your query is not right.

Fred
-- 


More information about the Valentina mailing list