List:General Discussion« Previous MessageNext Message »
From:Jerry Preeper Date:August 14 1999 1:25am
Subject:select query ? using like and not like
View as plain text  
I have a question regarding a select that I hope someone can help with.

select * from users where directory like 'dir' and not like 'dir\/';

In the column directory I have entries with

dir/pictures
dir dir/pictures
dir dir/gifs dir/pictures

I can get it to select the items with just dir/pictures, but I can't for
the life of me figure out how to select the rows that include dir (ie row 2
and row 3 but not row 1).  The query above gives me everything.  And I
can't always count on dir being at the beginning of the query, nor can I
assume it will be followed by something else with a space after it.  For
example it could be like
dir/pictures dir

Anyone have any ideas?

Jerry
Thread
select query ? using like and not likeJerry Preeper14 Aug
  • Re: select query ? using like and not likeThimble Smith14 Aug
Re: select query ? using like and not likepreeper@cts.com14 Aug
  • Re: select query ? using like and not likeMartin Ramsch14 Aug
    • Re: select query ? using like and not likeJerry Preeper14 Aug