Re: select statement sorting

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: select statement sorting
Дата
Msg-id 200403311804.09143.dev@archonet.com
обсуждение исходный текст
Ответ на select statement sorting  (Alexander Cohen <alex@toomuchspace.com>)
Ответы select distinct w/order by
Список pgsql-general
On Wednesday 31 March 2004 16:31, Alexander Cohen wrote:
> is it possible to have postgres return a "SELECT * FROM table ORDER BY
> table_column" query that is not case sensitive order?

SELECT first_name FROM foo ORDER BY lower(first_name)

Of course, then you can't guarantee whether you get "Alex" then "alex" or the
other way around, so you might want:

SELECT first_name FROM foo ORDER BY lower(first_name), first_name


> Also, i noticed that postgres will let me create groups, databases and
> users with spaces in their names, is this ok or should i check this
> beforehand and not allow this?

You need to quote the names to create them this way. If you do so, you need to
quote them when you use them, so:

CREATE MyTable / SELECT FROM mytable/MYTABLE/MyTaBle...
CREATE "MyTable" / SELECT FROM "MyTable"

--
  Richard Huxton
  Archonet Ltd

В списке pgsql-general по дате отправления:

Предыдущее
От: Diogo Biazus
Дата:
Сообщение: Re: Wich hardware suits best for large full-text indexed
Следующее
От: Diogo Biazus
Дата:
Сообщение: Re: Wich hardware suits best for large full-text indexed