Re: Failing query...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Failing query...
Дата
Msg-id 6992.966720865@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Failing query...  (Shaun <delius@progsoc.uts.edu.au>)
Список pgsql-sql
Shaun <delius@progsoc.uts.edu.au> writes:
> SELECT a.auction_id, a.user_id, c.other_names,
>        c.surname, c.email, a.reserve, a.close_time, a.short_desc,
>        a.long_desc, a.start_time,
>        (COALESCE((select MAX(bid) from bid where auction_id = a.auction_id
>        group by auction_id), 0)) as max_bid
> FROM Auction a, Customer c
> WHERE a.user_id = c.user_id
> AND a.auction_id = 754;

Sub-selects inside COALESCE don't work :-(.  This was just fixed about a
week ago --- it will be in 7.1.  In the meantime you might try it the
other way round:
      (select COALESCE(MAX(bid), 0) from bid where auction_id = a.auction_id)      as max_bid
        regards, tom lane


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

Предыдущее
От: Shaun
Дата:
Сообщение: Failing query...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Tuple size limit.