Re: selecting all columns but one

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: selecting all columns but one
Дата
Msg-id h4mu7d$as2$1@ger.gmane.org
обсуждение исходный текст
Ответ на selecting all columns but one  (blackwater dev <blackwaterdev@gmail.com>)
Список pgsql-general
blackwater dev, 28.07.2009 15:12:
> I have a table with a lot of columns.  One of the columns I want to
> alias so have a query of:
>
> select *, column as newname from mytable.
>
> The problem is I now have column and newname in the results.  I don't
> want to select column by column.  How can I do a select * but omit one?

You need to list all columns that you want explicitely.

Using SELECT * in a production application is considered bad practice anyway

Thomas

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: selecting all columns but one
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: Upgrading from 8.3 to 8.4 and Integer datatimes?