Re: Strange interaction of union and expressions

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Strange interaction of union and expressions
Дата
Msg-id 20050420201050.GA2218@dcc.uchile.cl
обсуждение исходный текст
Ответ на Strange interaction of union and expressions  (Aaron Bingham <bingham@cenix-bioscience.com>)
Список pgsql-general
On Wed, Apr 20, 2005 at 07:24:08PM +0200, Aaron Bingham wrote:

Hi,

> create table a (foo varchar);
>x insert into a (foo) values ('baz');
> create table b (foo varchar);
> insert into b (foo) values ('woof');
> select '"' || foo || '"' as foo
>     from (select foo from a) as bar
>         union select foo from b;

It's a precedence issue; not a problem really.  Try this:

select '"' || foo || '"' as foo
     from (select foo from a
         union select foo from b) as bar;

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"¿Que diferencia tiene para los muertos, los huérfanos, y aquellos que han
perdido su hogar, si la loca destrucción ha sido realizada bajo el nombre
del totalitarismo o del santo nombre de la libertad y la democracia?" (Gandhi)

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

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: Strange interaction of union and expressions
Следующее
От: Kevin Murphy
Дата:
Сообщение: Re: Strange interaction of union and expressions