| От | Doug McNaught |
|---|---|
| Тема | Re: ORDER BY and ignoring the , a , and an |
| Дата | |
| Msg-id | m366gsqqzy.fsf@belphigor.mcnaught.org обсуждение исходный текст |
| Ответ на | ORDER BY and ignoring the , a , and an ("Stoppel, Brett W" <bstoppel@ku.edu>) |
| Список | pgsql-general |
"Stoppel, Brett W" <bstoppel@ku.edu> writes: > Is it possible to have the ORDER BY option ignore the articles "the ", "a ", > and "an " at the beginning of a VARCHAR, CHAR, TEXT, et cetera field? In > other words, I want my results to come back alphabetized, while ignoring the > aforementioned articles. Only way I can think of would be to write a function to do the stripping yourself, say 'strip_articles(text) RETURNS text' and then in your SELECTS, do 'ORDER BY strip_articles(mycolumn)'. For performance you might also want to create an index on that same expression. You could write the function in any of the available server-side languages (pgsql, perl, tcl). -Doug
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера