Re: SQL command speed
От | Ross J. Reedstrom |
---|---|
Тема | Re: SQL command speed |
Дата | |
Msg-id | 20000518153909.B2549@rice.edu обсуждение исходный текст |
Ответ на | Re: SQL command speed (mig@utdt.edu) |
Ответы |
Library sort order (was Re: SQL command speed)
|
Список | pgsql-sql |
Hey crew: I've got a relatively simple SQL problem. In a db backed web site we're building, I'd like to fill a dropdown box with the contents of a validation table, in this case research institutions. I want to sort them alphabetically, but using "library rules": i.e. skip inital articles, since we've a few 'The University of Foo" and "The Johns Hopkins University", for example. I thought I had it with this SQL: SELECT InstName from Institutions ORDER BY ltrim (InstName, 'The'); Looked good, until I found 'Texas A&M University' sorting below York. Seems ltrim() removes inital charaters from the set of charaters, not inital strings, so I was sorting on 'xas A&M University' Anyone have some magic solution for this? Ross -- Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005
В списке pgsql-sql по дате отправления: