Re: [GENERAL] SQL Where Like - Range it?!

2001-04-27 Thread Len Morgan
>What I'd like to do is pull a list of records where there is a range of >last names; say from A - F. >select * from table where last_name LIKE 'A%' AND last_name LIKE 'F%' - >for example. > >The above code I've tried for this doesn't seem to work as I'd expect it >too? SELECT * FROM table WHERE

Re: [GENERAL] SQL Where LIKE - Range it!

2001-04-27 Thread Frank Bax
select * from table where last_name ~ '^[A-F]'; or select * from table where last_name between 'A' and 'G'; or select * from table where last_name >='A' and last_name<'G' The second one is broken if last_name='G' returns something. Use ~* in first example to ignore case.