Re: SQL Where Like - Range it?!
| От | Sterling |
|---|---|
| Тема | Re: SQL Where Like - Range it?! |
| Дата | |
| Msg-id | 3AE9CB59.3C429797@omeninc.com обсуждение исходный текст |
| Ответ на | Re: SQL Where Like - Range it?! ("Len Morgan" <len-morgan@crcom.net>) |
| Список | pgsql-general |
H- Thank you to all that have replied. Unfortunately none of the examples provided worked for me on my system. I tried: SELECT * from table where last_name BETWEEN 'A' AND 'G'; SELECT * from table where last_name >='A' AND last_name<'G'; SELECT * from table where last_name ~* '^[A-F]'; to no avail. 8^( I didn't find a between function in the postgres documentation. Is that some special function? I'm using PostgreSQL 6.5.3. If anyone has any further thoughts please drop a line. Thanks again and hopefully something will work out. -Sterling en Morgan wrote: > > >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 last_name BETWEEN 'A' AND 'Fzzzzzzzzzzzzz' ; > worked for me. > > You could also use BETWEEN 'A' AND 'G' to avoid all of the zzzzzzzzs at the > end. Crude but effective. > > len morgan > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly
В списке pgsql-general по дате отправления: